From a82f6fc8edd116b60a3617226ffc1b0bd9d44412 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 14 Feb 2018 11:35:16 +0000 Subject: [PATCH 01/40] Fixes OnChatStringRecieved returning previous message data --- Facepunch.Steamworks/Client/Lobby.cs | 231 ++++++++++++++------------- 1 file changed, 118 insertions(+), 113 deletions(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index f0a4dcb..510b4df 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -13,8 +13,8 @@ public Lobby Lobby { get { - if (_lobby == null) - _lobby = new Steamworks.Lobby(this); + if ( _lobby == null ) + _lobby = new Steamworks.Lobby( this ); return _lobby; } } @@ -33,15 +33,15 @@ public enum Type : int internal Client client; - public Lobby(Client c) + public Lobby( Client c ) { client = c; - SteamNative.LobbyDataUpdate_t.RegisterCallback(client, OnLobbyDataUpdatedAPI); - SteamNative.LobbyChatMsg_t.RegisterCallback(client, OnLobbyChatMessageRecievedAPI); - SteamNative.LobbyChatUpdate_t.RegisterCallback(client, OnLobbyStateUpdatedAPI); - SteamNative.GameLobbyJoinRequested_t.RegisterCallback(client, OnLobbyJoinRequestedAPI); - SteamNative.LobbyInvite_t.RegisterCallback(client, OnUserInvitedToLobbyAPI); - SteamNative.PersonaStateChange_t.RegisterCallback(client, OnLobbyMemberPersonaChangeAPI); + SteamNative.LobbyDataUpdate_t.RegisterCallback( client, OnLobbyDataUpdatedAPI ); + SteamNative.LobbyChatMsg_t.RegisterCallback( client, OnLobbyChatMessageRecievedAPI ); + SteamNative.LobbyChatUpdate_t.RegisterCallback( client, OnLobbyStateUpdatedAPI ); + SteamNative.GameLobbyJoinRequested_t.RegisterCallback( client, OnLobbyJoinRequestedAPI ); + SteamNative.LobbyInvite_t.RegisterCallback( client, OnUserInvitedToLobbyAPI ); + SteamNative.PersonaStateChange_t.RegisterCallback( client, OnLobbyMemberPersonaChangeAPI ); } /// @@ -63,23 +63,23 @@ public Lobby(Client c) /// 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) + public void Join( ulong lobbyID ) { Leave(); - client.native.matchmaking.JoinLobby(lobbyID, OnLobbyJoinedAPI); + client.native.matchmaking.JoinLobby( lobbyID, OnLobbyJoinedAPI ); } - void OnLobbyJoinedAPI(LobbyEnter_t callback, bool error) + void OnLobbyJoinedAPI( LobbyEnter_t callback, bool error ) { - if (error || (callback.EChatRoomEnterResponse != (uint)(SteamNative.ChatRoomEnterResponse.Success))) + if ( error || (callback.EChatRoomEnterResponse != (uint)(SteamNative.ChatRoomEnterResponse.Success)) ) { - if (OnLobbyJoined != null) { OnLobbyJoined(false); } + if ( OnLobbyJoined != null ) { OnLobbyJoined( false ); } return; } CurrentLobby = callback.SteamIDLobby; UpdateLobbyData(); - if (OnLobbyJoined != null) { OnLobbyJoined(true); } + if ( OnLobbyJoined != null ) { OnLobbyJoined( true ); } } /// @@ -92,33 +92,33 @@ void OnLobbyJoinedAPI(LobbyEnter_t callback, bool error) /// /// 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) + public void Create( Lobby.Type lobbyType, int maxMembers ) { - client.native.matchmaking.CreateLobby((SteamNative.LobbyType)lobbyType, maxMembers, OnLobbyCreatedAPI); + client.native.matchmaking.CreateLobby( (SteamNative.LobbyType)lobbyType, maxMembers, OnLobbyCreatedAPI ); createdLobbyType = lobbyType; } internal Type createdLobbyType; - internal void OnLobbyCreatedAPI(LobbyCreated_t callback, bool error) + internal void OnLobbyCreatedAPI( LobbyCreated_t callback, bool error ) { //from SpaceWarClient.cpp 793 - if (error || (callback.Result != Result.OK)) + if ( error || (callback.Result != Result.OK) ) { - if ( OnLobbyCreated != null) { OnLobbyCreated(false); } + if ( OnLobbyCreated != null ) { OnLobbyCreated( false ); } return; } //set owner specific properties Owner = client.SteamId; CurrentLobby = callback.SteamIDLobby; - CurrentLobbyData = new LobbyData(client, CurrentLobby); + CurrentLobbyData = new LobbyData( client, CurrentLobby ); Name = client.Username + "'s Lobby"; - CurrentLobbyData.SetData("appid", client.AppId.ToString()); + CurrentLobbyData.SetData( "appid", client.AppId.ToString() ); LobbyType = createdLobbyType; - CurrentLobbyData.SetData("lobbytype", LobbyType.ToString()); + CurrentLobbyData.SetData( "lobbytype", LobbyType.ToString() ); Joinable = true; - if (OnLobbyCreated != null) { OnLobbyCreated(true); } + if ( OnLobbyCreated != null ) { OnLobbyCreated( true ); } } /// @@ -135,7 +135,7 @@ public class LobbyData internal ulong lobby; internal Dictionary data; - public LobbyData(Client c, ulong l) + public LobbyData( Client c, ulong l ) { client = c; lobby = l; @@ -147,9 +147,9 @@ public LobbyData(Client c, ulong l) /// /// The key to find /// The value at key - public string GetData(string k) + public string GetData( string k ) { - if (data.ContainsKey(k)) + if ( data.ContainsKey( k ) ) { return data[k]; } @@ -161,12 +161,12 @@ public string GetData(string k) /// Get a list of all the data in the Lobby /// /// Dictionary of all the key/value pairs in the data - public Dictionary GetAllData() + public Dictionary GetAllData() { Dictionary returnData = new Dictionary(); - foreach(KeyValuePair item in data) + foreach ( KeyValuePair item in data ) { - returnData.Add(item.Key, item.Value); + returnData.Add( item.Key, item.Value ); } return returnData; } @@ -177,12 +177,12 @@ public Dictionary GetAllData() /// The key to set the value for /// The value of the Key /// True if data successfully set - public bool SetData(string k, string v) + public bool SetData( string k, string v ) { - if (data.ContainsKey(k)) + if ( data.ContainsKey( k ) ) { - if (data[k] == v) { return true; } - if (client.native.matchmaking.SetLobbyData(lobby, k, v)) + if ( data[k] == v ) { return true; } + if ( client.native.matchmaking.SetLobbyData( lobby, k, v ) ) { data[k] = v; return true; @@ -190,9 +190,9 @@ public bool SetData(string k, string v) } else { - if (client.native.matchmaking.SetLobbyData(lobby, k, v)) + if ( client.native.matchmaking.SetLobbyData( lobby, k, v ) ) { - data.Add(k, v); + data.Add( k, v ); return true; } } @@ -205,13 +205,13 @@ public bool SetData(string k, string v) /// /// The key to remove /// True if Key successfully removed - public bool RemoveData(string k) + public bool RemoveData( string k ) { - if (data.ContainsKey(k)) + if ( data.ContainsKey( k ) ) { - if (client.native.matchmaking.DeleteLobbyData(lobby, k)) + if ( client.native.matchmaking.DeleteLobbyData( lobby, k ) ) { - data.Remove(k); + data.Remove( k ); return true; } } @@ -224,10 +224,10 @@ public bool RemoveData(string k) /// /// 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) + public void SetMemberData( string key, string value ) { - if(CurrentLobby == 0) { return; } - client.native.matchmaking.SetLobbyMemberData(CurrentLobby, key, value); + if ( CurrentLobby == 0 ) { return; } + client.native.matchmaking.SetLobbyMemberData( CurrentLobby, key, value ); } /// @@ -236,23 +236,23 @@ public void SetMemberData(string key, string value) /// 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) + public string GetMemberData( ulong steamID, string key ) { - if (CurrentLobby == 0) { return "ERROR: NOT IN ANY LOBBY"; } - return client.native.matchmaking.GetLobbyMemberData(CurrentLobby, steamID, key); + if ( CurrentLobby == 0 ) { return "ERROR: NOT IN ANY LOBBY"; } + return client.native.matchmaking.GetLobbyMemberData( CurrentLobby, steamID, key ); } - internal void OnLobbyDataUpdatedAPI(LobbyDataUpdate_t callback, bool error) + internal void OnLobbyDataUpdatedAPI( LobbyDataUpdate_t callback, bool error ) { - if(error || (callback.SteamIDLobby != CurrentLobby)) { return; } - if(callback.SteamIDLobby == CurrentLobby) //actual lobby data was updated by owner + if ( error || (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 ( UserIsInCurrentLobby( callback.SteamIDMember ) ) //some member of this lobby updated their information { - if (OnLobbyMemberDataUpdated != null) { OnLobbyMemberDataUpdated(callback.SteamIDMember); } + if ( OnLobbyMemberDataUpdated != null ) { OnLobbyMemberDataUpdated( callback.SteamIDMember ); } } } @@ -261,17 +261,17 @@ internal void OnLobbyDataUpdatedAPI(LobbyDataUpdate_t callback, bool error) /// internal void UpdateLobbyData() { - int dataCount = client.native.matchmaking.GetLobbyDataCount(CurrentLobby); - CurrentLobbyData = new LobbyData(client, CurrentLobby); - for (int i = 0; i < dataCount; i++) + 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)) + if ( client.native.matchmaking.GetLobbyDataByIndex( CurrentLobby, i, out string key, out string value ) ) { - CurrentLobbyData.SetData(key, value); + CurrentLobbyData.SetData( key, value ); } } - if(OnLobbyDataUpdated != null) { OnLobbyDataUpdated(); } + if ( OnLobbyDataUpdated != null ) { OnLobbyDataUpdated(); } } /// @@ -289,12 +289,12 @@ public Type LobbyType { get { - if (!IsValid) { return Type.Error; } //if we're currently in a valid server - + 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) + string lobbyType = CurrentLobbyData.GetData( "lobbytype" ); + switch ( lobbyType ) { case "Private": return Type.Private; @@ -310,32 +310,37 @@ public Type LobbyType } set { - if(!IsValid) { return; } - if(client.native.matchmaking.SetLobbyType(CurrentLobby, (SteamNative.LobbyType)value)) + if ( !IsValid ) { return; } + if ( client.native.matchmaking.SetLobbyType( CurrentLobby, (SteamNative.LobbyType)value ) ) { - CurrentLobbyData.SetData("lobbytype", value.ToString()); + CurrentLobbyData.SetData( "lobbytype", value.ToString() ); } } } private static byte[] chatMessageData = new byte[1024 * 4]; - private unsafe void OnLobbyChatMessageRecievedAPI(LobbyChatMsg_t callback, bool error) + private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback, bool error ) { //from Client.Networking - if(error || callback.SteamIDLobby != CurrentLobby) + if ( error || 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) + fixed ( byte* p = chatMessageData ) { - readData = client.native.matchmaking.GetLobbyChatEntry(CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, chatMessageData.Length, out chatEntryType); + readData = client.native.matchmaking.GetLobbyChatEntry( CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, chatMessageData.Length, out chatEntryType ); } - OnChatMessageRecieved?.Invoke(steamid, chatMessageData, readData); - OnChatStringRecieved?.Invoke(steamid, Encoding.UTF8.GetString(chatMessageData)); + + OnChatMessageRecieved?.Invoke( steamid, chatMessageData, readData ); + + if ( readData > 0 ) + { + OnChatStringRecieved?.Invoke( steamid, Encoding.UTF8.GetString( chatMessageData, 0, readData ) ); + } } /// @@ -352,14 +357,14 @@ private unsafe void OnLobbyChatMessageRecievedAPI(LobbyChatMsg_t callback, bool /// 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) + public unsafe bool SendChatMessage( string message ) { - var data = Encoding.UTF8.GetBytes(message); - fixed (byte* p = data) + 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); + return client.native.matchmaking.SendLobbyChatMsg( CurrentLobby, (IntPtr)p, data.Length ); } } @@ -375,16 +380,16 @@ public enum MemberStateChange Banned = ChatMemberStateChange.Banned, } - internal void OnLobbyStateUpdatedAPI(LobbyChatUpdate_t callback, bool error) + internal void OnLobbyStateUpdatedAPI( LobbyChatUpdate_t callback, bool error ) { - if (error || callback.SteamIDLobby != CurrentLobby) + if ( error || callback.SteamIDLobby != CurrentLobby ) return; MemberStateChange change = (MemberStateChange)callback.GfChatMemberStateChange; ulong initiator = callback.SteamIDMakingChange; ulong affected = callback.SteamIDUserChanged; - OnLobbyStateChanged?.Invoke(change, initiator, affected); + OnLobbyStateChanged?.Invoke( change, initiator, affected ); } /// @@ -401,13 +406,13 @@ public string Name { get { - if (!IsValid) { return ""; } - return CurrentLobbyData.GetData("name"); + if ( !IsValid ) { return ""; } + return CurrentLobbyData.GetData( "name" ); } set { - if (!IsValid) { return; } - CurrentLobbyData.SetData("name", value); + if ( !IsValid ) { return; } + CurrentLobbyData.SetData( "name", value ); } } @@ -418,16 +423,16 @@ public ulong Owner { get { - if (IsValid) + if ( IsValid ) { - return client.native.matchmaking.GetLobbyOwner(CurrentLobby); + return client.native.matchmaking.GetLobbyOwner( CurrentLobby ); } return 0; } set { - if (Owner == value) return; - client.native.matchmaking.SetLobbyOwner(CurrentLobby, value); + if ( Owner == value ) return; + client.native.matchmaking.SetLobbyOwner( CurrentLobby, value ); } } @@ -438,9 +443,9 @@ public bool Joinable { get { - if (!IsValid) { return false; } - string joinable = CurrentLobbyData.GetData("joinable"); - switch (joinable) + if ( !IsValid ) { return false; } + string joinable = CurrentLobbyData.GetData( "joinable" ); + switch ( joinable ) { case "true": return true; @@ -452,10 +457,10 @@ public bool Joinable } set { - if (!IsValid) { return; } - if (client.native.matchmaking.SetLobbyJoinable(CurrentLobby, value)) + if ( !IsValid ) { return; } + if ( client.native.matchmaking.SetLobbyJoinable( CurrentLobby, value ) ) { - CurrentLobbyData.SetData("joinable", value.ToString()); + CurrentLobbyData.SetData( "joinable", value.ToString() ); } } } @@ -467,13 +472,13 @@ 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); + 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); + if ( !IsValid ) { return; } + client.native.matchmaking.SetLobbyMemberLimit( CurrentLobby, value ); } } @@ -482,7 +487,7 @@ public int MaxMembers /// public int NumMembers { - get { return client.native.matchmaking.GetNumLobbyMembers(CurrentLobby);} + get { return client.native.matchmaking.GetNumLobbyMembers( CurrentLobby ); } } /// @@ -490,9 +495,9 @@ public int NumMembers /// public void Leave() { - if (CurrentLobby != 0) + if ( CurrentLobby != 0 ) { - client.native.matchmaking.LeaveLobby(CurrentLobby); + client.native.matchmaking.LeaveLobby( CurrentLobby ); } CurrentLobby = 0; @@ -513,9 +518,9 @@ public void Dispose() public ulong[] GetMemberIDs() { ulong[] memIDs = new ulong[NumMembers]; - for (int i = 0; i < NumMembers; i++) + for ( int i = 0; i < NumMembers; i++ ) { - memIDs[i] = client.native.matchmaking.GetLobbyMemberByIndex(CurrentLobby, i); + memIDs[i] = client.native.matchmaking.GetLobbyMemberByIndex( CurrentLobby, i ); } return memIDs; } @@ -525,14 +530,14 @@ public ulong[] GetMemberIDs() /// /// SteamID of the user to check for /// - public bool UserIsInCurrentLobby(ulong steamID) + public bool UserIsInCurrentLobby( ulong steamID ) { if ( CurrentLobby == 0 ) return false; ulong[] mems = GetMemberIDs(); - for (int i = 0; i < mems.Length; i++) + for ( int i = 0; i < mems.Length; i++ ) { if ( mems[i] == steamID ) return true; @@ -545,15 +550,15 @@ public bool UserIsInCurrentLobby(ulong steamID) /// Invites the specified user to the CurrentLobby the user is in. /// /// ulong ID of person to invite - public bool InviteUserToLobby(ulong friendID) + public bool InviteUserToLobby( ulong friendID ) { - return client.native.matchmaking.InviteUserToLobby(CurrentLobby, friendID); + return client.native.matchmaking.InviteUserToLobby( CurrentLobby, friendID ); } - internal void OnUserInvitedToLobbyAPI(LobbyInvite_t callback, bool error) + internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback, bool error ) { - if (error || (callback.GameID != client.AppId)) { return; } - if (OnUserInvitedToLobby != null) { OnUserInvitedToLobby(callback.SteamIDLobby, callback.SteamIDUser); } + if ( error || (callback.GameID != client.AppId) ) { return; } + if ( OnUserInvitedToLobby != null ) { OnUserInvitedToLobby( callback.SteamIDLobby, callback.SteamIDUser ); } } @@ -565,19 +570,19 @@ internal void OnUserInvitedToLobbyAPI(LobbyInvite_t callback, bool error) /// /// 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, bool error) + internal void OnLobbyJoinRequestedAPI( GameLobbyJoinRequested_t callback, bool error ) { - if (error) { return; } - Join(callback.SteamIDLobby); + if ( error ) { return; } + Join( callback.SteamIDLobby ); } /// /// Makes sure we send an update callback if a Lobby user updates their information /// - internal void OnLobbyMemberPersonaChangeAPI(PersonaStateChange_t callback, bool error) + internal void OnLobbyMemberPersonaChangeAPI( PersonaStateChange_t callback, bool error ) { - if (error || !UserIsInCurrentLobby(callback.SteamID)) { return; } - if (OnLobbyMemberDataUpdated != null) { OnLobbyMemberDataUpdated(callback.SteamID); } + if ( error || !UserIsInCurrentLobby( callback.SteamID ) ) { return; } + if ( OnLobbyMemberDataUpdated != null ) { OnLobbyMemberDataUpdated( callback.SteamID ); } } /*not implemented From 04c7eb59dc940afc2dc05e002beeb9ac8418ed4c Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 14 Feb 2018 14:15:02 +0000 Subject: [PATCH 02/40] CallResults are queried --- .../Client/LeaderboardTest.cs | 5 + Facepunch.Steamworks/BaseSteamworks.cs | 22 + Facepunch.Steamworks/Client/Leaderboard.cs | 5 +- .../SteamNative/SteamNative.Callback.cs | 100 +- .../SteamNative.Platform.Linux32.cs | 1402 +- .../SteamNative.Platform.Linux64.cs | 1402 +- .../SteamNative/SteamNative.Platform.Mac.cs | 1402 +- .../SteamNative/SteamNative.Platform.Win32.cs | 1402 +- .../SteamNative/SteamNative.Platform.Win64.cs | 1402 +- .../SteamNative/SteamNative.Structs.cs | 13284 +++++----------- Generator/CodeWriter/PlatformClass.cs | 7 +- Generator/CodeWriter/Struct.cs | 48 +- 12 files changed, 7206 insertions(+), 13275 deletions(-) diff --git a/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs b/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs index cc1986a..3628d11 100644 --- a/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs +++ b/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs @@ -171,6 +171,11 @@ public void AddScoresCallback() 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"); diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 9b6db62..49652ab 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -25,6 +25,7 @@ public class BaseSteamworks : IDisposable internal Interop.NativeInterface native; private List CallbackHandles = new List(); + private List CallResults = new List(); protected BaseSteamworks( uint appId ) @@ -46,6 +47,12 @@ public virtual void Dispose() } CallbackHandles.Clear(); + foreach ( var h in CallResults ) + { + h.Dispose(); + } + CallResults.Clear(); + if ( Workshop != null ) { Workshop.Dispose(); @@ -98,6 +105,16 @@ 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() { Inventory.Update(); @@ -114,6 +131,11 @@ public void RunUpdateCallbacks() { if ( OnUpdate != null ) OnUpdate(); + + for( int i=0; i < CallResults.Count; i++ ) + { + CallResults[i].Try(); + } } /// diff --git a/Facepunch.Steamworks/Client/Leaderboard.cs b/Facepunch.Steamworks/Client/Leaderboard.cs index ff5b5e0..dcd9f39 100644 --- a/Facepunch.Steamworks/Client/Leaderboard.cs +++ b/Facepunch.Steamworks/Client/Leaderboard.cs @@ -107,6 +107,9 @@ private bool DeferOnCreated( Action onValid, FailureCallback onFailure = null ) 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; @@ -234,7 +237,7 @@ public bool AttachRemoteFile( RemoteFile file, AttachRemoteFileCallback onSucces } } ); - return handle.CallResultHandle != 0; + return handle.IsValid; } file.Share( () => diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs index 9d89b07..ede1d4f 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs @@ -50,21 +50,23 @@ internal class StdCall // internal class CallbackHandle : IDisposable { - internal BaseSteamworks steamworks; - internal SteamAPICall_t CallResultHandle; - internal bool CallResult; + 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() { - if ( CallResult ) - UnregisterCallResult(); - else - UnregisterCallback(); + UnregisterCallback(); if ( FuncA.IsAllocated ) FuncA.Free(); @@ -90,19 +92,81 @@ private void UnregisterCallback() if ( !PinnedCallback.IsAllocated ) return; - steamworks.native.api.SteamAPI_UnregisterCallback( PinnedCallback.AddrOfPinnedObject() ); + Steamworks.native.api.SteamAPI_UnregisterCallback( PinnedCallback.AddrOfPinnedObject() ); } - private void UnregisterCallResult() - { - if ( CallResultHandle == 0 ) - return; - - if ( !PinnedCallback.IsAllocated ) - return; - - steamworks.native.api.SteamAPI_UnregisterCallResult( PinnedCallback.AddrOfPinnedObject(), CallResultHandle ); - } + 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 ); + } + } + } } diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs index d990c9e..cef1b83 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs @@ -4263,799 +4263,799 @@ internal static unsafe class Native // // ISteamClient // - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr 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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); + [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 // - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); + [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 // - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr 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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr 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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); + [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 // - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t.PackSmall /*struct SteamUGCDetails_t **/ pDetails ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); + [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 // - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); + [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 // - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "libsteam_api.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 ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api.so" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImportAttribute( "libsteam_api.so" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); + [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 index cb38993..3b155bf 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs @@ -4263,799 +4263,799 @@ internal static unsafe class Native // // ISteamClient // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr 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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr 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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr 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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); + [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 // - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImportAttribute( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); + [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 index d475f22..989ad11 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs @@ -4263,799 +4263,799 @@ internal static unsafe class Native // // ISteamClient // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr 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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr 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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr 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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); + [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 // - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImportAttribute( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); + [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 index 750b297..8343ee2 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs @@ -4229,799 +4229,799 @@ internal static unsafe class Native // // ISteamClient // - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr 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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImportAttribute( "steam_api.dll" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); + [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 // - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api.dll" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api.dll" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); + [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 // - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImportAttribute( "steam_api.dll" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr 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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr 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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); + [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 // - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImportAttribute( "steam_api.dll" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImportAttribute( "steam_api.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); + [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 // - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImportAttribute( "steam_api.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImportAttribute( "steam_api.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); + [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 // - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "steam_api.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 ); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImportAttribute( "steam_api.dll" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImportAttribute( "steam_api.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImportAttribute( "steam_api.dll" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImportAttribute( "steam_api.dll" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); + [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 index dbfcb38..9b5fd80 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs @@ -4229,799 +4229,799 @@ internal static unsafe class Native // // ISteamClient // - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr 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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr 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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr 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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); + [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 // - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); + [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 // - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImportAttribute( "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 ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImportAttribute( "steam_api64.dll" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImportAttribute( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); + [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.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index af487a0..be5603c 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -7,27 +7,36 @@ namespace SteamNative [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct CallbackMsg_t { - public int SteamUser; // m_hSteamUser HSteamUser - public int Callback; // m_iCallback int - public IntPtr ParamPtr; // m_pubParam uint8 * - public int ParamCount; // m_cubParam int + 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. // - public static CallbackMsg_t FromPointer( IntPtr p ) + 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 { - public int SteamUser; // m_hSteamUser HSteamUser - public int Callback; // m_iCallback int - public IntPtr ParamPtr; // m_pubParam uint8 * - public int ParamCount; // m_cubParam int + 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 @@ -48,26 +57,35 @@ public static implicit operator CallbackMsg_t ( CallbackMsg_t.PackSmall d ) [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamServerConnectFailure_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 2; - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.SteamUser + 2; + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool StillRetrying; // m_bStillRetrying _Bool + internal bool StillRetrying; // m_bStillRetrying _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SteamServerConnectFailure_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool StillRetrying; // m_bStillRetrying _Bool + internal bool StillRetrying; // m_bStillRetrying _Bool // // Easily convert from PackSmall to SteamServerConnectFailure_t @@ -82,10 +100,9 @@ public static implicit operator SteamServerConnectFailure_t ( SteamServerConnec } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -198,22 +215,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamServersDisconnected_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 3; - public Result Result; // m_eResult enum EResult + 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. // - public static SteamServersDisconnected_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to SteamServersDisconnected_t @@ -227,10 +253,9 @@ public static implicit operator SteamServersDisconnected_t ( SteamServersDiscon } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -343,30 +368,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct ClientGameServerDeny_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 13; - public uint AppID; // m_uAppID uint32 - public uint GameServerIP; // m_unGameServerIP uint32 - public ushort GameServerPort; // m_usGameServerPort uint16 - public ushort Secure; // m_bSecure uint16 - public uint Reason; // m_uReason uint32 + 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. // - public static ClientGameServerDeny_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_uAppID uint32 - public uint GameServerIP; // m_unGameServerIP uint32 - public ushort GameServerPort; // m_usGameServerPort uint16 - public ushort Secure; // m_bSecure uint16 - public uint Reason; // m_uReason uint32 + 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 @@ -384,10 +418,9 @@ public static implicit operator ClientGameServerDeny_t ( ClientGameServerDeny_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -500,26 +533,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct ValidateAuthTicketResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 43; - public ulong SteamID; // m_SteamID class CSteamID - public AuthSessionResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse - public ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + 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. // - public static ValidateAuthTicketResponse_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_SteamID class CSteamID - public AuthSessionResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse - public ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + 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 @@ -535,10 +577,9 @@ public static implicit operator ValidateAuthTicketResponse_t ( ValidateAuthTick } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -651,26 +692,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MicroTxnAuthorizationResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 52; - public uint AppID; // m_unAppID uint32 - public ulong OrderID; // m_ulOrderID uint64 - public byte Authorized; // m_bAuthorized uint8 + 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. // - public static MicroTxnAuthorizationResponse_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_unAppID uint32 - public ulong OrderID; // m_ulOrderID uint64 - public byte Authorized; // m_bAuthorized uint8 + 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 @@ -686,10 +736,9 @@ public static implicit operator MicroTxnAuthorizationResponse_t ( MicroTxnAutho } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -802,22 +851,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct EncryptedAppTicketResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 54; - public Result Result; // m_eResult enum EResult + 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. // - public static EncryptedAppTicketResponse_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to EncryptedAppTicketResponse_t @@ -831,140 +889,14 @@ public static implicit operator EncryptedAppTicketResponse_t ( EncryptedAppTick } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( EncryptedAppTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( EncryptedAppTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -1077,24 +1009,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GetAuthSessionTicketResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 63; - public uint AuthTicket; // m_hAuthTicket HAuthTicket - public Result Result; // m_eResult enum EResult + 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. // - public static GetAuthSessionTicketResponse_t FromPointer( IntPtr p ) + 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 { - public uint AuthTicket; // m_hAuthTicket HAuthTicket - public Result Result; // m_eResult enum EResult + internal uint AuthTicket; // m_hAuthTicket HAuthTicket + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to GetAuthSessionTicketResponse_t @@ -1109,10 +1050,9 @@ public static implicit operator GetAuthSessionTicketResponse_t ( GetAuthSession } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -1225,24 +1165,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GameWebCallback_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 64; + internal const int CallbackId = CallbackIdentifiers.SteamUser + 64; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_szURL char [256] + internal string URL; // m_szURL char [256] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GameWebCallback_t FromPointer( IntPtr p ) + 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)] - public string URL; // m_szURL char [256] + internal string URL; // m_szURL char [256] // // Easily convert from PackSmall to GameWebCallback_t @@ -1256,10 +1205,9 @@ public static implicit operator GameWebCallback_t ( GameWebCallback_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -1372,24 +1320,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct StoreAuthURLResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 65; + internal const int CallbackId = CallbackIdentifiers.SteamUser + 65; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] - public string URL; // m_szURL char [512] + internal string URL; // m_szURL char [512] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static StoreAuthURLResponse_t FromPointer( IntPtr p ) + 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)] - public string URL; // m_szURL char [512] + internal string URL; // m_szURL char [512] // // Easily convert from PackSmall to StoreAuthURLResponse_t @@ -1403,140 +1360,14 @@ public static implicit operator StoreAuthURLResponse_t ( StoreAuthURLResponse_t } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StoreAuthURLResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StoreAuthURLResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -1649,29 +1480,38 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct FriendGameInfo_t { - public ulong GameID; // m_gameID class CGameID - public uint GameIP; // m_unGameIP uint32 - public ushort GamePort; // m_usGamePort uint16 - public ushort QueryPort; // m_usQueryPort uint16 - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID + 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. // - public static FriendGameInfo_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_gameID class CGameID - public uint GameIP; // m_unGameIP uint32 - public ushort GamePort; // m_usGamePort uint16 - public ushort QueryPort; // m_usQueryPort uint16 - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID + 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 @@ -1693,23 +1533,32 @@ public static implicit operator FriendGameInfo_t ( FriendGameInfo_t.PackSmall d [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct FriendSessionStateInfo_t { - public uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 - public byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 + 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. // - public static FriendSessionStateInfo_t FromPointer( IntPtr p ) + 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 { - public uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 - public byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 + internal uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 + internal byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 // // Easily convert from PackSmall to FriendSessionStateInfo_t @@ -1728,24 +1577,33 @@ public static implicit operator FriendSessionStateInfo_t ( FriendSessionStateIn [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct PersonaStateChange_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 4; - public ulong SteamID; // m_ulSteamID uint64 - public int ChangeFlags; // m_nChangeFlags int + 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. // - public static PersonaStateChange_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_ulSteamID uint64 - public int ChangeFlags; // m_nChangeFlags int + internal ulong SteamID; // m_ulSteamID uint64 + internal int ChangeFlags; // m_nChangeFlags int // // Easily convert from PackSmall to PersonaStateChange_t @@ -1760,10 +1618,9 @@ public static implicit operator PersonaStateChange_t ( PersonaStateChange_t.Pac } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -1876,22 +1733,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GameOverlayActivated_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 31; - public byte Active; // m_bActive uint8 + 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. // - public static GameOverlayActivated_t FromPointer( IntPtr p ) + 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 { - public byte Active; // m_bActive uint8 + internal byte Active; // m_bActive uint8 // // Easily convert from PackSmall to GameOverlayActivated_t @@ -1905,10 +1771,9 @@ public static implicit operator GameOverlayActivated_t ( GameOverlayActivated_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2021,28 +1886,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GameServerChangeRequested_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 32; + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 32; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string Server; // m_rgchServer char [64] + internal string Server; // m_rgchServer char [64] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string Password; // m_rgchPassword char [64] + internal string Password; // m_rgchPassword char [64] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GameServerChangeRequested_t FromPointer( IntPtr p ) + 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)] - public string Server; // m_rgchServer char [64] + internal string Server; // m_rgchServer char [64] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string Password; // m_rgchPassword char [64] + internal string Password; // m_rgchPassword char [64] // // Easily convert from PackSmall to GameServerChangeRequested_t @@ -2057,10 +1931,9 @@ public static implicit operator GameServerChangeRequested_t ( GameServerChangeR } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2173,24 +2046,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameLobbyJoinRequested_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 33; - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID + 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. // - public static GameLobbyJoinRequested_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID // // Easily convert from PackSmall to GameLobbyJoinRequested_t @@ -2205,10 +2087,9 @@ public static implicit operator GameLobbyJoinRequested_t ( GameLobbyJoinRequest } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2321,28 +2202,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct AvatarImageLoaded_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 34; - public ulong SteamID; // m_steamID class CSteamID - public int Image; // m_iImage int - public int Wide; // m_iWide int - public int Tall; // m_iTall int + 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. // - public static AvatarImageLoaded_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_steamID class CSteamID - public int Image; // m_iImage int - public int Wide; // m_iWide int - public int Tall; // m_iTall int + 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 @@ -2359,10 +2249,9 @@ public static implicit operator AvatarImageLoaded_t ( AvatarImageLoaded_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2475,26 +2364,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct ClanOfficerListResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 35; - public ulong SteamIDClan; // m_steamIDClan class CSteamID - public int COfficers; // m_cOfficers int - public byte Success; // m_bSuccess uint8 + 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. // - public static ClanOfficerListResponse_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDClan; // m_steamIDClan class CSteamID - public int COfficers; // m_cOfficers int - public byte Success; // m_bSuccess uint8 + 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 @@ -2510,140 +2408,14 @@ public static implicit operator ClanOfficerListResponse_t ( ClanOfficerListResp } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ClanOfficerListResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ClanOfficerListResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2756,24 +2528,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct FriendRichPresenceUpdate_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 36; - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID - public uint AppID; // m_nAppID AppId_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. // - public static FriendRichPresenceUpdate_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID - public uint AppID; // m_nAppID AppId_t + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to FriendRichPresenceUpdate_t @@ -2788,10 +2569,9 @@ public static implicit operator FriendRichPresenceUpdate_t ( FriendRichPresence } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -2904,26 +2684,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameRichPresenceJoinRequested_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 37; - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 37; + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Connect; // m_rgchConnect char [256] + internal string Connect; // m_rgchConnect char [256] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GameRichPresenceJoinRequested_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Connect; // m_rgchConnect char [256] + internal string Connect; // m_rgchConnect char [256] // // Easily convert from PackSmall to GameRichPresenceJoinRequested_t @@ -2938,10 +2727,9 @@ public static implicit operator GameRichPresenceJoinRequested_t ( GameRichPrese } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3054,26 +2842,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameConnectedClanChatMsg_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 38; - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int MessageID; // m_iMessageID int + 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. // - public static GameConnectedClanChatMsg_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int MessageID; // m_iMessageID int + 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 @@ -3089,10 +2886,9 @@ public static implicit operator GameConnectedClanChatMsg_t ( GameConnectedClanC } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3205,24 +3001,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameConnectedChatJoin_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 39; - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static GameConnectedChatJoin_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID // // Easily convert from PackSmall to GameConnectedChatJoin_t @@ -3237,10 +3042,9 @@ public static implicit operator GameConnectedChatJoin_t ( GameConnectedChatJoin } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3353,32 +3157,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameConnectedChatLeave_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 40; - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 40; + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool Kicked; // m_bKicked _Bool + internal bool Kicked; // m_bKicked _Bool [MarshalAs(UnmanagedType.I1)] - public bool Dropped; // m_bDropped _Bool + internal bool Dropped; // m_bDropped _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GameConnectedChatLeave_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool Kicked; // m_bKicked _Bool + internal bool Kicked; // m_bKicked _Bool [MarshalAs(UnmanagedType.I1)] - public bool Dropped; // m_bDropped _Bool + internal bool Dropped; // m_bDropped _Bool // // Easily convert from PackSmall to GameConnectedChatLeave_t @@ -3395,10 +3208,9 @@ public static implicit operator GameConnectedChatLeave_t ( GameConnectedChatLea } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3511,24 +3323,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct DownloadClanActivityCountsResult_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 41; + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 41; [MarshalAs(UnmanagedType.I1)] - public bool Success; // m_bSuccess _Bool + internal bool Success; // m_bSuccess _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static DownloadClanActivityCountsResult_t FromPointer( IntPtr p ) + 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)] - public bool Success; // m_bSuccess _Bool + internal bool Success; // m_bSuccess _Bool // // Easily convert from PackSmall to DownloadClanActivityCountsResult_t @@ -3542,10 +3363,9 @@ public static implicit operator DownloadClanActivityCountsResult_t ( DownloadCl } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3658,24 +3478,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct JoinClanChatRoomCompletionResult_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 42; - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ChatRoomEnterResponse ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse + 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. // - public static JoinClanChatRoomCompletionResult_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - public ChatRoomEnterResponse ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ChatRoomEnterResponse ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse // // Easily convert from PackSmall to JoinClanChatRoomCompletionResult_t @@ -3690,140 +3519,14 @@ public static implicit operator JoinClanChatRoomCompletionResult_t ( JoinClanCh } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( JoinClanChatRoomCompletionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( JoinClanChatRoomCompletionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -3936,24 +3639,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GameConnectedFriendChatMsg_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 43; - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int MessageID; // m_iMessageID int + 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. // - public static GameConnectedFriendChatMsg_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int MessageID; // m_iMessageID int + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + internal int MessageID; // m_iMessageID int // // Easily convert from PackSmall to GameConnectedFriendChatMsg_t @@ -3968,10 +3680,9 @@ public static implicit operator GameConnectedFriendChatMsg_t ( GameConnectedFri } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -4084,26 +3795,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct FriendsGetFollowerCount_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 44; - public Result Result; // m_eResult enum EResult - public ulong SteamID; // m_steamID class CSteamID - public int Count; // m_nCount int + 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. // - public static FriendsGetFollowerCount_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamID; // m_steamID class CSteamID - public int Count; // m_nCount int + 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 @@ -4119,140 +3839,14 @@ public static implicit operator FriendsGetFollowerCount_t ( FriendsGetFollowerC } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsGetFollowerCount_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsGetFollowerCount_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -4365,28 +3959,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct FriendsIsFollowing_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 45; - public Result Result; // m_eResult enum EResult - public ulong SteamID; // m_steamID class CSteamID + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 45; + internal Result Result; // m_eResult enum EResult + internal ulong SteamID; // m_steamID class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool IsFollowing; // m_bIsFollowing _Bool + internal bool IsFollowing; // m_bIsFollowing _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static FriendsIsFollowing_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamID; // m_steamID class CSteamID + internal Result Result; // m_eResult enum EResult + internal ulong SteamID; // m_steamID class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool IsFollowing; // m_bIsFollowing _Bool + internal bool IsFollowing; // m_bIsFollowing _Bool // // Easily convert from PackSmall to FriendsIsFollowing_t @@ -4402,140 +4005,14 @@ public static implicit operator FriendsIsFollowing_t ( FriendsIsFollowing_t.Pac } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsIsFollowing_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsIsFollowing_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -4648,30 +4125,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct FriendsEnumerateFollowingList_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 46; - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 46; + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - public ulong[] GSteamID; // m_rgSteamID class CSteamID [50] - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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. // - public static FriendsEnumerateFollowingList_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - public ulong[] GSteamID; // m_rgSteamID class CSteamID [50] - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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 @@ -4688,140 +4174,14 @@ public static implicit operator FriendsEnumerateFollowingList_t ( FriendsEnumer } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsEnumerateFollowingList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsEnumerateFollowingList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -4934,30 +4294,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SetPersonaNameResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamFriends + 47; + internal const int CallbackId = CallbackIdentifiers.SteamFriends + 47; [MarshalAs(UnmanagedType.I1)] - public bool Success; // m_bSuccess _Bool + internal bool Success; // m_bSuccess _Bool [MarshalAs(UnmanagedType.I1)] - public bool LocalSuccess; // m_bLocalSuccess _Bool - public Result Result; // m_result enum EResult + 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. // - public static SetPersonaNameResponse_t FromPointer( IntPtr p ) + 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)] - public bool Success; // m_bSuccess _Bool + internal bool Success; // m_bSuccess _Bool [MarshalAs(UnmanagedType.I1)] - public bool LocalSuccess; // m_bLocalSuccess _Bool - public Result Result; // m_result enum EResult + internal bool LocalSuccess; // m_bLocalSuccess _Bool + internal Result Result; // m_result enum EResult // // Easily convert from PackSmall to SetPersonaNameResponse_t @@ -4973,140 +4342,14 @@ public static implicit operator SetPersonaNameResponse_t ( SetPersonaNameRespon } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SetPersonaNameResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SetPersonaNameResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -5219,22 +4462,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LowBatteryPower_t { - public const int CallbackId = CallbackIdentifiers.SteamUtils + 2; - public byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 + 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. // - public static LowBatteryPower_t FromPointer( IntPtr p ) + 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 { - public byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 + internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 // // Easily convert from PackSmall to LowBatteryPower_t @@ -5248,10 +4500,9 @@ public static implicit operator LowBatteryPower_t ( LowBatteryPower_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -5364,26 +4615,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamAPICallCompleted_t { - public const int CallbackId = CallbackIdentifiers.SteamUtils + 3; - public ulong AsyncCall; // m_hAsyncCall SteamAPICall_t - public int Callback; // m_iCallback int - public uint ParamCount; // m_cubParam uint32 + 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. // - public static SteamAPICallCompleted_t FromPointer( IntPtr p ) + 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 { - public ulong AsyncCall; // m_hAsyncCall SteamAPICall_t - public int Callback; // m_iCallback int - public uint ParamCount; // m_cubParam uint32 + 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 @@ -5399,10 +4659,9 @@ public static implicit operator SteamAPICallCompleted_t ( SteamAPICallCompleted } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -5515,22 +4774,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct CheckFileSignature_t { - public const int CallbackId = CallbackIdentifiers.SteamUtils + 5; - public CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature + 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. // - public static CheckFileSignature_t FromPointer( IntPtr p ) + 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 { - public CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature + internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature // // Easily convert from PackSmall to CheckFileSignature_t @@ -5544,140 +4812,14 @@ public static implicit operator CheckFileSignature_t ( CheckFileSignature_t.Pac } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( CheckFileSignature_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( CheckFileSignature_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -5790,26 +4932,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GamepadTextInputDismissed_t { - public const int CallbackId = CallbackIdentifiers.SteamUtils + 14; + internal const int CallbackId = CallbackIdentifiers.SteamUtils + 14; [MarshalAs(UnmanagedType.I1)] - public bool Submitted; // m_bSubmitted _Bool - public uint SubmittedText; // m_unSubmittedText uint32 + 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. // - public static GamepadTextInputDismissed_t FromPointer( IntPtr p ) + 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)] - public bool Submitted; // m_bSubmitted _Bool - public uint SubmittedText; // m_unSubmittedText uint32 + internal bool Submitted; // m_bSubmitted _Bool + internal uint SubmittedText; // m_unSubmittedText uint32 // // Easily convert from PackSmall to GamepadTextInputDismissed_t @@ -5824,10 +4975,9 @@ public static implicit operator GamepadTextInputDismissed_t ( GamepadTextInputD } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -5941,26 +5091,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo internal struct MatchMakingKeyValuePair_t { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Key; // m_szKey char [256] + internal string Key; // m_szKey char [256] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Value; // m_szValue char [256] + internal string Value; // m_szValue char [256] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static MatchMakingKeyValuePair_t FromPointer( IntPtr p ) + 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)] - public string Key; // m_szKey char [256] + internal string Key; // m_szKey char [256] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Value; // m_szValue char [256] + internal string Value; // m_szValue char [256] // // Easily convert from PackSmall to MatchMakingKeyValuePair_t @@ -5979,25 +5138,34 @@ public static implicit operator MatchMakingKeyValuePair_t ( MatchMakingKeyValue [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct servernetadr_t { - public ushort ConnectionPort; // m_usConnectionPort uint16 - public ushort QueryPort; // m_usQueryPort uint16 - public uint IP; // m_unIP uint32 + 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. // - public static servernetadr_t FromPointer( IntPtr p ) + 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 { - public ushort ConnectionPort; // m_usConnectionPort uint16 - public ushort QueryPort; // m_usQueryPort uint16 - public uint IP; // m_unIP uint32 + 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 @@ -6017,73 +5185,82 @@ public static implicit operator servernetadr_t ( servernetadr_t.PackSmall d ) [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct gameserveritem_t { - public servernetadr_t NetAdr; // m_NetAdr class servernetadr_t - public int Ping; // m_nPing int + internal servernetadr_t NetAdr; // m_NetAdr class servernetadr_t + internal int Ping; // m_nPing int [MarshalAs(UnmanagedType.I1)] - public bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool + internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool [MarshalAs(UnmanagedType.I1)] - public bool DoNotRefresh; // m_bDoNotRefresh _Bool + internal bool DoNotRefresh; // m_bDoNotRefresh _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string GameDir; // m_szGameDir char [32] + internal string GameDir; // m_szGameDir char [32] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string Map; // m_szMap char [32] + internal string Map; // m_szMap char [32] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string GameDescription; // m_szGameDescription char [64] - public uint AppID; // m_nAppID uint32 - public int Players; // m_nPlayers int - public int MaxPlayers; // m_nMaxPlayers int - public int BotPlayers; // m_nBotPlayers int + 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)] - public bool Password; // m_bPassword _Bool + internal bool Password; // m_bPassword _Bool [MarshalAs(UnmanagedType.I1)] - public bool Secure; // m_bSecure _Bool - public uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 - public int ServerVersion; // m_nServerVersion int + internal bool Secure; // m_bSecure _Bool + internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 + internal int ServerVersion; // m_nServerVersion int [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string ServerName; // m_szServerName char [64] + internal string ServerName; // m_szServerName char [64] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string GameTags; // m_szGameTags char [128] - public ulong SteamID; // m_steamID class CSteamID + 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. // - public static gameserveritem_t FromPointer( IntPtr p ) + 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 { - public servernetadr_t NetAdr; // m_NetAdr class servernetadr_t - public int Ping; // m_nPing int + internal servernetadr_t NetAdr; // m_NetAdr class servernetadr_t + internal int Ping; // m_nPing int [MarshalAs(UnmanagedType.I1)] - public bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool + internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool [MarshalAs(UnmanagedType.I1)] - public bool DoNotRefresh; // m_bDoNotRefresh _Bool + internal bool DoNotRefresh; // m_bDoNotRefresh _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string GameDir; // m_szGameDir char [32] + internal string GameDir; // m_szGameDir char [32] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string Map; // m_szMap char [32] + internal string Map; // m_szMap char [32] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string GameDescription; // m_szGameDescription char [64] - public uint AppID; // m_nAppID uint32 - public int Players; // m_nPlayers int - public int MaxPlayers; // m_nMaxPlayers int - public int BotPlayers; // m_nBotPlayers int + 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)] - public bool Password; // m_bPassword _Bool + internal bool Password; // m_bPassword _Bool [MarshalAs(UnmanagedType.I1)] - public bool Secure; // m_bSecure _Bool - public uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 - public int ServerVersion; // m_nServerVersion int + internal bool Secure; // m_bSecure _Bool + internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 + internal int ServerVersion; // m_nServerVersion int [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string ServerName; // m_szServerName char [64] + internal string ServerName; // m_szServerName char [64] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string GameTags; // m_szGameTags char [128] - public ulong SteamID; // m_steamID class CSteamID + internal string GameTags; // m_szGameTags char [128] + internal ulong SteamID; // m_steamID class CSteamID // // Easily convert from PackSmall to gameserveritem_t @@ -6118,36 +5295,45 @@ public static implicit operator gameserveritem_t ( gameserveritem_t.PackSmall d [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct FavoritesListChanged_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 2; - public uint IP; // m_nIP uint32 - public uint QueryPort; // m_nQueryPort uint32 - public uint ConnPort; // m_nConnPort uint32 - public uint AppID; // m_nAppID uint32 - public uint Flags; // m_nFlags uint32 + 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)] - public bool Add; // m_bAdd _Bool - public uint AccountId; // m_unAccountId AccountID_t + 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. // - public static FavoritesListChanged_t FromPointer( IntPtr p ) + 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 { - public uint IP; // m_nIP uint32 - public uint QueryPort; // m_nQueryPort uint32 - public uint ConnPort; // m_nConnPort uint32 - public uint AppID; // m_nAppID uint32 - public uint Flags; // m_nFlags uint32 + 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)] - public bool Add; // m_bAdd _Bool - public uint AccountId; // m_unAccountId AccountID_t + internal bool Add; // m_bAdd _Bool + internal uint AccountId; // m_unAccountId AccountID_t // // Easily convert from PackSmall to FavoritesListChanged_t @@ -6167,10 +5353,9 @@ public static implicit operator FavoritesListChanged_t ( FavoritesListChanged_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -6283,26 +5468,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyInvite_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 3; - public ulong SteamIDUser; // m_ulSteamIDUser uint64 - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong GameID; // m_ulGameID uint64 + 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. // - public static LobbyInvite_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_ulSteamIDUser uint64 - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong GameID; // m_ulGameID uint64 + 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 @@ -6318,10 +5512,9 @@ public static implicit operator LobbyInvite_t ( LobbyInvite_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -6434,30 +5627,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyEnter_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 4; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public uint GfChatPermissions; // m_rgfChatPermissions uint32 + internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 4; + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal uint GfChatPermissions; // m_rgfChatPermissions uint32 [MarshalAs(UnmanagedType.I1)] - public bool Locked; // m_bLocked _Bool - public uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 + 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. // - public static LobbyEnter_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public uint GfChatPermissions; // m_rgfChatPermissions uint32 + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal uint GfChatPermissions; // m_rgfChatPermissions uint32 [MarshalAs(UnmanagedType.I1)] - public bool Locked; // m_bLocked _Bool - public uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 + internal bool Locked; // m_bLocked _Bool + internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 // // Easily convert from PackSmall to LobbyEnter_t @@ -6474,140 +5676,14 @@ public static implicit operator LobbyEnter_t ( LobbyEnter_t.PackSmall d ) } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyEnter_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyEnter_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -6720,26 +5796,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyDataUpdate_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 5; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDMember; // m_ulSteamIDMember uint64 - public byte Success; // m_bSuccess uint8 + 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. // - public static LobbyDataUpdate_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDMember; // m_ulSteamIDMember uint64 - public byte Success; // m_bSuccess uint8 + 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 @@ -6755,10 +5840,9 @@ public static implicit operator LobbyDataUpdate_t ( LobbyDataUpdate_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -6871,28 +5955,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyChatUpdate_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 6; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 - public ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 - public uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 + 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. // - public static LobbyChatUpdate_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 - public ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 - public uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 + 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 @@ -6909,10 +6002,9 @@ public static implicit operator LobbyChatUpdate_t ( LobbyChatUpdate_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -7025,28 +6117,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyChatMsg_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 7; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDUser; // m_ulSteamIDUser uint64 - public byte ChatEntryType; // m_eChatEntryType uint8 - public uint ChatID; // m_iChatID uint32 + 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. // - public static LobbyChatMsg_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDUser; // m_ulSteamIDUser uint64 - public byte ChatEntryType; // m_eChatEntryType uint8 - public uint ChatID; // m_iChatID uint32 + 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 @@ -7063,10 +6164,9 @@ public static implicit operator LobbyChatMsg_t ( LobbyChatMsg_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -7179,28 +6279,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyGameCreated_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 9; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 - public uint IP; // m_unIP uint32 - public ushort Port; // m_usPort uint16 + 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. // - public static LobbyGameCreated_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 - public uint IP; // m_unIP uint32 - public ushort Port; // m_usPort uint16 + 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 @@ -7217,10 +6326,9 @@ public static implicit operator LobbyGameCreated_t ( LobbyGameCreated_t.PackSma } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -7333,22 +6441,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyMatchList_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 10; - public uint LobbiesMatching; // m_nLobbiesMatching uint32 + 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. // - public static LobbyMatchList_t FromPointer( IntPtr p ) + 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 { - public uint LobbiesMatching; // m_nLobbiesMatching uint32 + internal uint LobbiesMatching; // m_nLobbiesMatching uint32 // // Easily convert from PackSmall to LobbyMatchList_t @@ -7362,140 +6479,14 @@ public static implicit operator LobbyMatchList_t ( LobbyMatchList_t.PackSmall d } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyMatchList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyMatchList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -7608,26 +6599,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyKicked_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 12; - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 - public byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 + 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. // - public static LobbyKicked_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - public ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 - public byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 + 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 @@ -7643,10 +6643,9 @@ public static implicit operator LobbyKicked_t ( LobbyKicked_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -7759,24 +6758,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LobbyCreated_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 13; - public Result Result; // m_eResult enum EResult - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + 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. // - public static LobbyCreated_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 // // Easily convert from PackSmall to LobbyCreated_t @@ -7791,140 +6799,14 @@ public static implicit operator LobbyCreated_t ( LobbyCreated_t.PackSmall d ) } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8037,26 +6919,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct PSNGameBootInviteResult_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 15; + internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 15; [MarshalAs(UnmanagedType.I1)] - public bool GameBootInviteExists; // m_bGameBootInviteExists _Bool - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID + 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. // - public static PSNGameBootInviteResult_t FromPointer( IntPtr p ) + 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)] - public bool GameBootInviteExists; // m_bGameBootInviteExists _Bool - public ulong SteamIDLobby; // m_steamIDLobby class CSteamID + internal bool GameBootInviteExists; // m_bGameBootInviteExists _Bool + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID // // Easily convert from PackSmall to PSNGameBootInviteResult_t @@ -8071,10 +6962,9 @@ public static implicit operator PSNGameBootInviteResult_t ( PSNGameBootInviteRe } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8187,22 +7077,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct FavoritesListAccountsUpdated_t { - public const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 16; - public Result Result; // m_eResult enum EResult + 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. // - public static FavoritesListAccountsUpdated_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to FavoritesListAccountsUpdated_t @@ -8216,10 +7115,9 @@ public static implicit operator FavoritesListAccountsUpdated_t ( FavoritesListA } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8332,23 +7230,32 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamParamStringArray_t { - public IntPtr Strings; // m_ppStrings const char ** - public int NumStrings; // m_nNumStrings int32 + 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. // - public static SteamParamStringArray_t FromPointer( IntPtr p ) + 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 { - public IntPtr Strings; // m_ppStrings const char ** - public int NumStrings; // m_nNumStrings int32 + internal IntPtr Strings; // m_ppStrings const char ** + internal int NumStrings; // m_nNumStrings int32 // // Easily convert from PackSmall to SteamParamStringArray_t @@ -8367,26 +7274,35 @@ public static implicit operator SteamParamStringArray_t ( SteamParamStringArray [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageAppSyncedClient_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 1; - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult - public int NumDownloads; // m_unNumDownloads int + 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. // - public static RemoteStorageAppSyncedClient_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult - public int NumDownloads; // m_unNumDownloads int + 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 @@ -8402,10 +7318,9 @@ public static implicit operator RemoteStorageAppSyncedClient_t ( RemoteStorageA } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8518,26 +7433,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageAppSyncedServer_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 2; - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult - public int NumUploads; // m_unNumUploads int + 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. // - public static RemoteStorageAppSyncedServer_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult - public int NumUploads; // m_unNumUploads int + 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 @@ -8553,10 +7477,9 @@ public static implicit operator RemoteStorageAppSyncedServer_t ( RemoteStorageA } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8669,34 +7592,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageAppSyncProgress_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 3; + internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 3; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - public string CurrentFile; // m_rgchCurrentFile char [260] - public uint AppID; // m_nAppID AppId_t - public uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 - public double DAppPercentComplete; // m_dAppPercentComplete double + 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)] - public bool Uploading; // m_bUploading _Bool + internal bool Uploading; // m_bUploading _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageAppSyncProgress_t FromPointer( IntPtr p ) + 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)] - public string CurrentFile; // m_rgchCurrentFile char [260] - public uint AppID; // m_nAppID AppId_t - public uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 - public double DAppPercentComplete; // m_dAppPercentComplete double + 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)] - public bool Uploading; // m_bUploading _Bool + internal bool Uploading; // m_bUploading _Bool // // Easily convert from PackSmall to RemoteStorageAppSyncProgress_t @@ -8714,10 +7646,9 @@ public static implicit operator RemoteStorageAppSyncProgress_t ( RemoteStorageA } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8830,24 +7761,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageAppSyncStatusCheck_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 5; - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult + 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. // - public static RemoteStorageAppSyncStatusCheck_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t - public Result Result; // m_eResult enum EResult + internal uint AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to RemoteStorageAppSyncStatusCheck_t @@ -8862,10 +7802,9 @@ public static implicit operator RemoteStorageAppSyncStatusCheck_t ( RemoteStora } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -8978,28 +7917,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageFileShareResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 7; - public Result Result; // m_eResult enum EResult - public ulong File; // m_hFile UGCHandle_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)] - public string Filename; // m_rgchFilename char [260] + internal string Filename; // m_rgchFilename char [260] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageFileShareResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong File; // m_hFile UGCHandle_t + internal Result Result; // m_eResult enum EResult + internal ulong File; // m_hFile UGCHandle_t [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - public string Filename; // m_rgchFilename char [260] + internal string Filename; // m_rgchFilename char [260] // // Easily convert from PackSmall to RemoteStorageFileShareResult_t @@ -9015,140 +7963,14 @@ public static implicit operator RemoteStorageFileShareResult_t ( RemoteStorageF } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileShareResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileShareResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -9261,28 +8083,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishFileResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 9; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStoragePublishFileResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t [MarshalAs(UnmanagedType.I1)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Easily convert from PackSmall to RemoteStoragePublishFileResult_t @@ -9298,10 +8129,9 @@ public static implicit operator RemoteStoragePublishFileResult_t ( RemoteStorag } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -9414,24 +8244,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageDeletePublishedFileResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 11; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static RemoteStorageDeletePublishedFileResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to RemoteStorageDeletePublishedFileResult_t @@ -9446,140 +8285,14 @@ public static implicit operator RemoteStorageDeletePublishedFileResult_t ( Remo } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageDeletePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageDeletePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -9692,30 +8405,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageEnumerateUserPublishedFilesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 12; - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageEnumerateUserPublishedFilesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] // // Easily convert from PackSmall to RemoteStorageEnumerateUserPublishedFilesResult_t @@ -9732,140 +8454,14 @@ public static implicit operator RemoteStorageEnumerateUserPublishedFilesResult_t } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserPublishedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserPublishedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -9978,24 +8574,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageSubscribePublishedFileResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 13; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static RemoteStorageSubscribePublishedFileResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to RemoteStorageSubscribePublishedFileResult_t @@ -10010,140 +8615,14 @@ public static implicit operator RemoteStorageSubscribePublishedFileResult_t ( R } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageSubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageSubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -10256,34 +8735,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 14; - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - public uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] + internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageEnumerateUserSubscribedFilesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - public uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] + internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] // // Easily convert from PackSmall to RemoteStorageEnumerateUserSubscribedFilesResult_t @@ -10301,140 +8789,14 @@ public static implicit operator RemoteStorageEnumerateUserSubscribedFilesResult_ } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -10547,24 +8909,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageUnsubscribePublishedFileResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 15; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static RemoteStorageUnsubscribePublishedFileResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to RemoteStorageUnsubscribePublishedFileResult_t @@ -10579,140 +8950,14 @@ public static implicit operator RemoteStorageUnsubscribePublishedFileResult_t ( } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUnsubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUnsubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -10825,28 +9070,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageUpdatePublishedFileResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 16; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageUpdatePublishedFileResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t [MarshalAs(UnmanagedType.I1)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Easily convert from PackSmall to RemoteStorageUpdatePublishedFileResult_t @@ -10862,140 +9116,14 @@ public static implicit operator RemoteStorageUpdatePublishedFileResult_t ( Remo } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUpdatePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUpdatePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -11108,34 +9236,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageDownloadUGCResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 17; - public Result Result; // m_eResult enum EResult - public ulong File; // m_hFile UGCHandle_t - public uint AppID; // m_nAppID AppId_t - public int SizeInBytes; // m_nSizeInBytes int32 + 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)] - public string PchFileName; // m_pchFileName char [260] - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + 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. // - public static RemoteStorageDownloadUGCResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong File; // m_hFile UGCHandle_t - public uint AppID; // m_nAppID AppId_t - public int SizeInBytes; // m_nSizeInBytes int32 + 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)] - public string PchFileName; // m_pchFileName char [260] - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + internal string PchFileName; // m_pchFileName char [260] + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 // // Easily convert from PackSmall to RemoteStorageDownloadUGCResult_t @@ -11154,140 +9291,14 @@ public static implicit operator RemoteStorageDownloadUGCResult_t ( RemoteStorag } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageDownloadUGCResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageDownloadUGCResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -11400,78 +9411,87 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageGetPublishedFileDetailsResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 18; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint CreatorAppID; // m_nCreatorAppID AppId_t - public uint ConsumerAppID; // m_nConsumerAppID AppId_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)] - public string Title; // m_rgchTitle char [129] + internal string Title; // m_rgchTitle char [129] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - public string Description; // m_rgchDescription char [8000] - public ulong File; // m_hFile UGCHandle_t - public ulong PreviewFile; // m_hPreviewFile UGCHandle_t - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - public uint TimeCreated; // m_rtimeCreated uint32 - public uint TimeUpdated; // m_rtimeUpdated uint32 - public RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + 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)] - public bool Banned; // m_bBanned _Bool + internal bool Banned; // m_bBanned _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - public string Tags; // m_rgchTags char [1025] + internal string Tags; // m_rgchTags char [1025] [MarshalAs(UnmanagedType.I1)] - public bool TagsTruncated; // m_bTagsTruncated _Bool + internal bool TagsTruncated; // m_bTagsTruncated _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - public string PchFileName; // m_pchFileName char [260] - public int FileSize; // m_nFileSize int32 - public int PreviewFileSize; // m_nPreviewFileSize int32 + internal string PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_rgchURL char [256] - public WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType + internal string URL; // m_rgchURL char [256] + internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType [MarshalAs(UnmanagedType.I1)] - public bool AcceptedForUse; // m_bAcceptedForUse _Bool + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageGetPublishedFileDetailsResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint CreatorAppID; // m_nCreatorAppID AppId_t - public uint ConsumerAppID; // m_nConsumerAppID AppId_t + 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)] - public string Title; // m_rgchTitle char [129] + internal string Title; // m_rgchTitle char [129] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - public string Description; // m_rgchDescription char [8000] - public ulong File; // m_hFile UGCHandle_t - public ulong PreviewFile; // m_hPreviewFile UGCHandle_t - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - public uint TimeCreated; // m_rtimeCreated uint32 - public uint TimeUpdated; // m_rtimeUpdated uint32 - public RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + 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)] - public bool Banned; // m_bBanned _Bool + internal bool Banned; // m_bBanned _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - public string Tags; // m_rgchTags char [1025] + internal string Tags; // m_rgchTags char [1025] [MarshalAs(UnmanagedType.I1)] - public bool TagsTruncated; // m_bTagsTruncated _Bool + internal bool TagsTruncated; // m_bTagsTruncated _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - public string PchFileName; // m_pchFileName char [260] - public int FileSize; // m_nFileSize int32 - public int PreviewFileSize; // m_nPreviewFileSize int32 + internal string PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_rgchURL char [256] - public WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType + internal string URL; // m_rgchURL char [256] + internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType [MarshalAs(UnmanagedType.I1)] - public bool AcceptedForUse; // m_bAcceptedForUse _Bool + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool // // Easily convert from PackSmall to RemoteStorageGetPublishedFileDetailsResult_t @@ -11505,140 +9525,14 @@ public static implicit operator RemoteStorageGetPublishedFileDetailsResult_t ( } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedFileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedFileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -11751,38 +9645,47 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageEnumerateWorkshopFilesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 19; - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] - public float[] GScore; // m_rgScore float [50] - public uint AppId; // m_nAppId AppId_t - public uint StartIndex; // m_unStartIndex uint32 + 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. // - public static RemoteStorageEnumerateWorkshopFilesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] - public float[] GScore; // m_rgScore float [50] - public uint AppId; // m_nAppId AppId_t - public uint StartIndex; // m_unStartIndex uint32 + 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 @@ -11802,140 +9705,14 @@ public static implicit operator RemoteStorageEnumerateWorkshopFilesResult_t ( R } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -12048,32 +9825,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 20; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_unPublishedFileId PublishedFileId_t - public int VotesFor; // m_nVotesFor int32 - public int VotesAgainst; // m_nVotesAgainst int32 - public int Reports; // m_nReports int32 - public float FScore; // m_fScore float + 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. // - public static RemoteStorageGetPublishedItemVoteDetailsResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_unPublishedFileId PublishedFileId_t - public int VotesFor; // m_nVotesFor int32 - public int VotesAgainst; // m_nVotesAgainst int32 - public int Reports; // m_nReports int32 - public float FScore; // m_fScore float + 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 @@ -12092,140 +9878,14 @@ public static implicit operator RemoteStorageGetPublishedItemVoteDetailsResult_t } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedItemVoteDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedItemVoteDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -12338,24 +9998,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishedFileSubscribed_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 21; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_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. // - public static RemoteStoragePublishedFileSubscribed_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to RemoteStoragePublishedFileSubscribed_t @@ -12370,10 +10039,9 @@ public static implicit operator RemoteStoragePublishedFileSubscribed_t ( Remote } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -12486,24 +10154,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishedFileUnsubscribed_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 22; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_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. // - public static RemoteStoragePublishedFileUnsubscribed_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to RemoteStoragePublishedFileUnsubscribed_t @@ -12518,10 +10195,9 @@ public static implicit operator RemoteStoragePublishedFileUnsubscribed_t ( Remo } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -12634,24 +10310,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishedFileDeleted_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 23; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_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. // - public static RemoteStoragePublishedFileDeleted_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to RemoteStoragePublishedFileDeleted_t @@ -12666,10 +10351,9 @@ public static implicit operator RemoteStoragePublishedFileDeleted_t ( RemoteSto } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -12782,24 +10466,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 24; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static RemoteStorageUpdateUserPublishedItemVoteResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to RemoteStorageUpdateUserPublishedItemVoteResult_t @@ -12814,140 +10507,14 @@ public static implicit operator RemoteStorageUpdateUserPublishedItemVoteResult_t } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUpdateUserPublishedItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUpdateUserPublishedItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -13060,26 +10627,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageUserVoteDetails_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 25; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public WorkshopVote Vote; // m_eVote enum EWorkshopVote + 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. // - public static RemoteStorageUserVoteDetails_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public WorkshopVote Vote; // m_eVote enum EWorkshopVote + 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 @@ -13095,10 +10671,9 @@ public static implicit operator RemoteStorageUserVoteDetails_t ( RemoteStorageU } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -13211,30 +10786,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 26; - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageEnumerateUserSharedWorkshopFilesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] // // Easily convert from PackSmall to RemoteStorageEnumerateUserSharedWorkshopFilesResult_t @@ -13251,10 +10835,9 @@ public static implicit operator RemoteStorageEnumerateUserSharedWorkshopFilesRes } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -13367,26 +10950,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageSetUserPublishedFileActionResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 27; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction + 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. // - public static RemoteStorageSetUserPublishedFileActionResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction + 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 @@ -13402,140 +10994,14 @@ public static implicit operator RemoteStorageSetUserPublishedFileActionResult_t } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageSetUserPublishedFileActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageSetUserPublishedFileActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -13648,36 +11114,45 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 28; - public Result Result; // m_eResult enum EResult - public WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - public uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] + internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStorageEnumeratePublishedFilesByUserActionResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - public int ResultsReturned; // m_nResultsReturned int32 - public int TotalResultCount; // m_nTotalResultCount int32 + 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)] - public ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - public uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] + internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] // // Easily convert from PackSmall to RemoteStorageEnumeratePublishedFilesByUserActionResult_t @@ -13696,140 +11171,14 @@ public static implicit operator RemoteStorageEnumeratePublishedFilesByUserAction } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -13942,26 +11291,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishFileProgress_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 29; - public double DPercentFile; // m_dPercentFile double + internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 29; + internal double DPercentFile; // m_dPercentFile double [MarshalAs(UnmanagedType.I1)] - public bool Preview; // m_bPreview _Bool + internal bool Preview; // m_bPreview _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static RemoteStoragePublishFileProgress_t FromPointer( IntPtr p ) + 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 { - public double DPercentFile; // m_dPercentFile double + internal double DPercentFile; // m_dPercentFile double [MarshalAs(UnmanagedType.I1)] - public bool Preview; // m_bPreview _Bool + internal bool Preview; // m_bPreview _Bool // // Easily convert from PackSmall to RemoteStoragePublishFileProgress_t @@ -13976,140 +11334,14 @@ public static implicit operator RemoteStoragePublishFileProgress_t ( RemoteStor } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -14222,26 +11454,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStoragePublishedFileUpdated_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 30; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t - public ulong Unused; // m_ulUnused uint64 + 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. // - public static RemoteStoragePublishedFileUpdated_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t - public ulong Unused; // m_ulUnused uint64 + 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 @@ -14257,10 +11498,9 @@ public static implicit operator RemoteStoragePublishedFileUpdated_t ( RemoteSto } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -14373,22 +11613,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageFileWriteAsyncComplete_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 31; - public Result Result; // m_eResult enum EResult + 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. // - public static RemoteStorageFileWriteAsyncComplete_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to RemoteStorageFileWriteAsyncComplete_t @@ -14402,140 +11651,14 @@ public static implicit operator RemoteStorageFileWriteAsyncComplete_t ( RemoteS } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileWriteAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileWriteAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -14648,28 +11771,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoteStorageFileReadAsyncComplete_t { - public const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 32; - public ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t - public Result Result; // m_eResult enum EResult - public uint Offset; // m_nOffset uint32 - public uint Read; // m_cubRead uint32 + 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. // - public static RemoteStorageFileReadAsyncComplete_t FromPointer( IntPtr p ) + 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 { - public ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t - public Result Result; // m_eResult enum EResult - public uint Offset; // m_nOffset uint32 - public uint Read; // m_cubRead uint32 + 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 @@ -14686,140 +11818,14 @@ public static implicit operator RemoteStorageFileReadAsyncComplete_t ( RemoteSt } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileReadAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileReadAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -14932,29 +11938,38 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LeaderboardEntry_t { - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int GlobalRank; // m_nGlobalRank int32 - public int Score; // m_nScore int32 - public int CDetails; // m_cDetails int32 - public ulong UGC; // m_hUGC UGCHandle_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. // - public static LeaderboardEntry_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_steamIDUser class CSteamID - public int GlobalRank; // m_nGlobalRank int32 - public int Score; // m_nScore int32 - public int CDetails; // m_cDetails int32 - public ulong UGC; // m_hUGC UGCHandle_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 // // Easily convert from PackSmall to LeaderboardEntry_t @@ -14976,26 +11991,35 @@ public static implicit operator LeaderboardEntry_t ( LeaderboardEntry_t.PackSma [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct UserStatsReceived_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 1; - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static UserStatsReceived_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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 @@ -15011,140 +12035,14 @@ public static implicit operator UserStatsReceived_t ( UserStatsReceived_t.PackS } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -15257,24 +12155,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct UserStatsStored_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 2; - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + 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. // - public static UserStatsStored_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to UserStatsStored_t @@ -15289,10 +12196,9 @@ public static implicit operator UserStatsStored_t ( UserStatsStored_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -15405,34 +12311,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct UserAchievementStored_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 3; - public ulong GameID; // m_nGameID uint64 + internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 3; + internal ulong GameID; // m_nGameID uint64 [MarshalAs(UnmanagedType.I1)] - public bool GroupAchievement; // m_bGroupAchievement _Bool + internal bool GroupAchievement; // m_bGroupAchievement _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string AchievementName; // m_rgchAchievementName char [128] - public uint CurProgress; // m_nCurProgress uint32 - public uint MaxProgress; // m_nMaxProgress uint32 + 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. // - public static UserAchievementStored_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 + internal ulong GameID; // m_nGameID uint64 [MarshalAs(UnmanagedType.I1)] - public bool GroupAchievement; // m_bGroupAchievement _Bool + internal bool GroupAchievement; // m_bGroupAchievement _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string AchievementName; // m_rgchAchievementName char [128] - public uint CurProgress; // m_nCurProgress uint32 - public uint MaxProgress; // m_nMaxProgress uint32 + 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 @@ -15450,10 +12365,9 @@ public static implicit operator UserAchievementStored_t ( UserAchievementStored } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -15566,24 +12480,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LeaderboardFindResult_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 4; - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public byte LeaderboardFound; // m_bLeaderboardFound uint8 + 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. // - public static LeaderboardFindResult_t FromPointer( IntPtr p ) + 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 { - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public byte LeaderboardFound; // m_bLeaderboardFound uint8 + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal byte LeaderboardFound; // m_bLeaderboardFound uint8 // // Easily convert from PackSmall to LeaderboardFindResult_t @@ -15598,140 +12521,14 @@ public static implicit operator LeaderboardFindResult_t ( LeaderboardFindResult } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardFindResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardFindResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -15844,26 +12641,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LeaderboardScoresDownloaded_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 5; - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t - public int CEntryCount; // m_cEntryCount int + 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. // - public static LeaderboardScoresDownloaded_t FromPointer( IntPtr p ) + 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 { - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t - public int CEntryCount; // m_cEntryCount int + 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 @@ -15879,140 +12685,14 @@ public static implicit operator LeaderboardScoresDownloaded_t ( LeaderboardScor } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardScoresDownloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardScoresDownloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -16125,32 +12805,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LeaderboardScoreUploaded_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 6; - public byte Success; // m_bSuccess uint8 - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public int Score; // m_nScore int32 - public byte ScoreChanged; // m_bScoreChanged uint8 - public int GlobalRankNew; // m_nGlobalRankNew int - public int GlobalRankPrevious; // m_nGlobalRankPrevious int + 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. // - public static LeaderboardScoreUploaded_t FromPointer( IntPtr p ) + 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 { - public byte Success; // m_bSuccess uint8 - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - public int Score; // m_nScore int32 - public byte ScoreChanged; // m_bScoreChanged uint8 - public int GlobalRankNew; // m_nGlobalRankNew int - public int GlobalRankPrevious; // m_nGlobalRankPrevious int + 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 @@ -16169,140 +12858,14 @@ public static implicit operator LeaderboardScoreUploaded_t ( LeaderboardScoreUp } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardScoreUploaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardScoreUploaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -16415,24 +12978,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct NumberOfCurrentPlayers_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 7; - public byte Success; // m_bSuccess uint8 - public int CPlayers; // m_cPlayers int32 + 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. // - public static NumberOfCurrentPlayers_t FromPointer( IntPtr p ) + 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 { - public byte Success; // m_bSuccess uint8 - public int CPlayers; // m_cPlayers int32 + internal byte Success; // m_bSuccess uint8 + internal int CPlayers; // m_cPlayers int32 // // Easily convert from PackSmall to NumberOfCurrentPlayers_t @@ -16447,140 +13019,14 @@ public static implicit operator NumberOfCurrentPlayers_t ( NumberOfCurrentPlaye } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( NumberOfCurrentPlayers_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( NumberOfCurrentPlayers_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -16693,22 +13139,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct UserStatsUnloaded_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 8; - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static UserStatsUnloaded_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID // // Easily convert from PackSmall to UserStatsUnloaded_t @@ -16722,10 +13177,9 @@ public static implicit operator UserStatsUnloaded_t ( UserStatsUnloaded_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -16838,32 +13292,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct UserAchievementIconFetched_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 9; - public ulong GameID; // m_nGameID class CGameID + internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 9; + internal ulong GameID; // m_nGameID class CGameID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string AchievementName; // m_rgchAchievementName char [128] + internal string AchievementName; // m_rgchAchievementName char [128] [MarshalAs(UnmanagedType.I1)] - public bool Achieved; // m_bAchieved _Bool - public int IconHandle; // m_nIconHandle int + 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. // - public static UserAchievementIconFetched_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID class CGameID + internal ulong GameID; // m_nGameID class CGameID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string AchievementName; // m_rgchAchievementName char [128] + internal string AchievementName; // m_rgchAchievementName char [128] [MarshalAs(UnmanagedType.I1)] - public bool Achieved; // m_bAchieved _Bool - public int IconHandle; // m_nIconHandle int + internal bool Achieved; // m_bAchieved _Bool + internal int IconHandle; // m_nIconHandle int // // Easily convert from PackSmall to UserAchievementIconFetched_t @@ -16880,10 +13343,9 @@ public static implicit operator UserAchievementIconFetched_t ( UserAchievementI } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -16996,24 +13458,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GlobalAchievementPercentagesReady_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 10; - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + 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. // - public static GlobalAchievementPercentagesReady_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to GlobalAchievementPercentagesReady_t @@ -17028,140 +13499,14 @@ public static implicit operator GlobalAchievementPercentagesReady_t ( GlobalAch } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GlobalAchievementPercentagesReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GlobalAchievementPercentagesReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -17274,24 +13619,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct LeaderboardUGCSet_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 11; - public Result Result; // m_eResult enum EResult - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_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. // - public static LeaderboardUGCSet_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal Result Result; // m_eResult enum EResult + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t // // Easily convert from PackSmall to LeaderboardUGCSet_t @@ -17306,140 +13660,14 @@ public static implicit operator LeaderboardUGCSet_t ( LeaderboardUGCSet_t.PackS } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardUGCSet_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardUGCSet_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -17552,26 +13780,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct PS3TrophiesInstalled_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 12; - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult - public ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 + 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. // - public static PS3TrophiesInstalled_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult - public ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 + 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 @@ -17587,10 +13824,9 @@ public static implicit operator PS3TrophiesInstalled_t ( PS3TrophiesInstalled_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -17703,24 +13939,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GlobalStatsReceived_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 12; - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + 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. // - public static GlobalStatsReceived_t FromPointer( IntPtr p ) + 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 { - public ulong GameID; // m_nGameID uint64 - public Result Result; // m_eResult enum EResult + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to GlobalStatsReceived_t @@ -17735,140 +13980,14 @@ public static implicit operator GlobalStatsReceived_t ( GlobalStatsReceived_t.P } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GlobalStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GlobalStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -17981,22 +14100,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct DlcInstalled_t { - public const int CallbackId = CallbackIdentifiers.SteamApps + 5; - public uint AppID; // m_nAppID AppId_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. // - public static DlcInstalled_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to DlcInstalled_t @@ -18010,10 +14138,9 @@ public static implicit operator DlcInstalled_t ( DlcInstalled_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -18126,24 +14253,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RegisterActivationCodeResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamApps + 8; - public RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult - public uint PackageRegistered; // m_unPackageRegistered uint32 + 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. // - public static RegisterActivationCodeResponse_t FromPointer( IntPtr p ) + 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 { - public RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult - public uint PackageRegistered; // m_unPackageRegistered uint32 + internal RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult + internal uint PackageRegistered; // m_unPackageRegistered uint32 // // Easily convert from PackSmall to RegisterActivationCodeResponse_t @@ -18158,10 +14294,9 @@ public static implicit operator RegisterActivationCodeResponse_t ( RegisterActi } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -18274,30 +14409,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct AppProofOfPurchaseKeyResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamApps + 21; - public Result Result; // m_eResult enum EResult - public uint AppID; // m_nAppID uint32 - public uint CchKeyLength; // m_cchKeyLength uint32 + 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)] - public string Key; // m_rgchKey char [240] + internal string Key; // m_rgchKey char [240] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static AppProofOfPurchaseKeyResponse_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public uint AppID; // m_nAppID uint32 - public uint CchKeyLength; // m_cchKeyLength uint32 + internal Result Result; // m_eResult enum EResult + internal uint AppID; // m_nAppID uint32 + internal uint CchKeyLength; // m_cchKeyLength uint32 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 240)] - public string Key; // m_rgchKey char [240] + internal string Key; // m_rgchKey char [240] // // Easily convert from PackSmall to AppProofOfPurchaseKeyResponse_t @@ -18314,10 +14458,9 @@ public static implicit operator AppProofOfPurchaseKeyResponse_t ( AppProofOfPur } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -18430,30 +14573,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct FileDetailsResult_t { - public const int CallbackId = CallbackIdentifiers.SteamApps + 23; - public Result Result; // m_eResult enum EResult - public ulong FileSize; // m_ulFileSize uint64 + 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)] - public char FileSHA; // m_FileSHA uint8 [20] - public uint Flags; // m_unFlags uint32 + 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. // - public static FileDetailsResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong FileSize; // m_ulFileSize uint64 + internal Result Result; // m_eResult enum EResult + internal ulong FileSize; // m_ulFileSize uint64 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] - public char FileSHA; // m_FileSHA uint8 [20] - public uint Flags; // m_unFlags uint32 + internal char FileSHA; // m_FileSHA uint8 [20] + internal uint Flags; // m_unFlags uint32 // // Easily convert from PackSmall to FileDetailsResult_t @@ -18470,140 +14622,14 @@ public static implicit operator FileDetailsResult_t ( FileDetailsResult_t.PackS } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -18716,35 +14742,44 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct P2PSessionState_t { - public byte ConnectionActive; // m_bConnectionActive uint8 - public byte Connecting; // m_bConnecting uint8 - public byte P2PSessionError; // m_eP2PSessionError uint8 - public byte UsingRelay; // m_bUsingRelay uint8 - public int BytesQueuedForSend; // m_nBytesQueuedForSend int32 - public int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 - public uint RemoteIP; // m_nRemoteIP uint32 - public ushort RemotePort; // m_nRemotePort uint16 + 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. // - public static P2PSessionState_t FromPointer( IntPtr p ) + 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 { - public byte ConnectionActive; // m_bConnectionActive uint8 - public byte Connecting; // m_bConnecting uint8 - public byte P2PSessionError; // m_eP2PSessionError uint8 - public byte UsingRelay; // m_bUsingRelay uint8 - public int BytesQueuedForSend; // m_nBytesQueuedForSend int32 - public int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 - public uint RemoteIP; // m_nRemoteIP uint32 - public ushort RemotePort; // m_nRemotePort uint16 + 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 @@ -18769,22 +14804,31 @@ public static implicit operator P2PSessionState_t ( P2PSessionState_t.PackSmall [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct P2PSessionRequest_t { - public const int CallbackId = CallbackIdentifiers.SteamNetworking + 2; - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID + 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. // - public static P2PSessionRequest_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID + internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID // // Easily convert from PackSmall to P2PSessionRequest_t @@ -18798,10 +14842,9 @@ public static implicit operator P2PSessionRequest_t ( P2PSessionRequest_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -18914,24 +14957,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct P2PSessionConnectFail_t { - public const int CallbackId = CallbackIdentifiers.SteamNetworking + 3; - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID - public byte P2PSessionError; // m_eP2PSessionError uint8 + 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. // - public static P2PSessionConnectFail_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID - public byte P2PSessionError; // m_eP2PSessionError uint8 + internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID + internal byte P2PSessionError; // m_eP2PSessionError uint8 // // Easily convert from PackSmall to P2PSessionConnectFail_t @@ -18946,10 +14998,9 @@ public static implicit operator P2PSessionConnectFail_t ( P2PSessionConnectFail } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19062,28 +15113,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct SocketStatusCallback_t { - public const int CallbackId = CallbackIdentifiers.SteamNetworking + 1; - public uint Socket; // m_hSocket SNetSocket_t - public uint ListenSocket; // m_hListenSocket SNetListenSocket_t - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID - public int SNetSocketState; // m_eSNetSocketState int + 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. // - public static SocketStatusCallback_t FromPointer( IntPtr p ) + 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 { - public uint Socket; // m_hSocket SNetSocket_t - public uint ListenSocket; // m_hListenSocket SNetListenSocket_t - public ulong SteamIDRemote; // m_steamIDRemote class CSteamID - public int SNetSocketState; // m_eSNetSocketState int + 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 @@ -19100,10 +15160,9 @@ public static implicit operator SocketStatusCallback_t ( SocketStatusCallback_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19216,24 +15275,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct ScreenshotReady_t { - public const int CallbackId = CallbackIdentifiers.SteamScreenshots + 1; - public uint Local; // m_hLocal ScreenshotHandle - public Result Result; // m_eResult enum EResult + 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. // - public static ScreenshotReady_t FromPointer( IntPtr p ) + 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 { - public uint Local; // m_hLocal ScreenshotHandle - public Result Result; // m_eResult enum EResult + internal uint Local; // m_hLocal ScreenshotHandle + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to ScreenshotReady_t @@ -19248,10 +15316,9 @@ public static implicit operator ScreenshotReady_t ( ScreenshotReady_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19364,22 +15431,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct VolumeHasChanged_t { - public const int CallbackId = CallbackIdentifiers.SteamMusic + 2; - public float NewVolume; // m_flNewVolume float + 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. // - public static VolumeHasChanged_t FromPointer( IntPtr p ) + 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 { - public float NewVolume; // m_flNewVolume float + internal float NewVolume; // m_flNewVolume float // // Easily convert from PackSmall to VolumeHasChanged_t @@ -19393,10 +15469,9 @@ public static implicit operator VolumeHasChanged_t ( VolumeHasChanged_t.PackSma } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19509,24 +15584,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerWantsShuffled_t { - public const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 9; + internal const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 9; [MarshalAs(UnmanagedType.I1)] - public bool Shuffled; // m_bShuffled _Bool + internal bool Shuffled; // m_bShuffled _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static MusicPlayerWantsShuffled_t FromPointer( IntPtr p ) + 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)] - public bool Shuffled; // m_bShuffled _Bool + internal bool Shuffled; // m_bShuffled _Bool // // Easily convert from PackSmall to MusicPlayerWantsShuffled_t @@ -19540,10 +15624,9 @@ public static implicit operator MusicPlayerWantsShuffled_t ( MusicPlayerWantsSh } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19656,24 +15739,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerWantsLooped_t { - public const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 10; + internal const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 10; [MarshalAs(UnmanagedType.I1)] - public bool Looped; // m_bLooped _Bool + internal bool Looped; // m_bLooped _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static MusicPlayerWantsLooped_t FromPointer( IntPtr p ) + 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)] - public bool Looped; // m_bLooped _Bool + internal bool Looped; // m_bLooped _Bool // // Easily convert from PackSmall to MusicPlayerWantsLooped_t @@ -19687,10 +15779,9 @@ public static implicit operator MusicPlayerWantsLooped_t ( MusicPlayerWantsLoop } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19803,22 +15894,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerWantsVolume_t { - public const int CallbackId = CallbackIdentifiers.SteamMusic + 11; - public float NewVolume; // m_flNewVolume float + 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. // - public static MusicPlayerWantsVolume_t FromPointer( IntPtr p ) + 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 { - public float NewVolume; // m_flNewVolume float + internal float NewVolume; // m_flNewVolume float // // Easily convert from PackSmall to MusicPlayerWantsVolume_t @@ -19832,10 +15932,9 @@ public static implicit operator MusicPlayerWantsVolume_t ( MusicPlayerWantsVolu } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -19948,22 +16047,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerSelectsQueueEntry_t { - public const int CallbackId = CallbackIdentifiers.SteamMusic + 12; - public int NID; // nID int + 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. // - public static MusicPlayerSelectsQueueEntry_t FromPointer( IntPtr p ) + 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 { - public int NID; // nID int + internal int NID; // nID int // // Easily convert from PackSmall to MusicPlayerSelectsQueueEntry_t @@ -19977,10 +16085,9 @@ public static implicit operator MusicPlayerSelectsQueueEntry_t ( MusicPlayerSel } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20093,22 +16200,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerSelectsPlaylistEntry_t { - public const int CallbackId = CallbackIdentifiers.SteamMusic + 13; - public int NID; // nID int + 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. // - public static MusicPlayerSelectsPlaylistEntry_t FromPointer( IntPtr p ) + 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 { - public int NID; // nID int + internal int NID; // nID int // // Easily convert from PackSmall to MusicPlayerSelectsPlaylistEntry_t @@ -20122,10 +16238,9 @@ public static implicit operator MusicPlayerSelectsPlaylistEntry_t ( MusicPlayer } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20238,22 +16353,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct MusicPlayerWantsPlayingRepeatStatus_t { - public const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 14; - public int PlayingRepeatStatus; // m_nPlayingRepeatStatus int + 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. // - public static MusicPlayerWantsPlayingRepeatStatus_t FromPointer( IntPtr p ) + 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 { - public int PlayingRepeatStatus; // m_nPlayingRepeatStatus int + internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int // // Easily convert from PackSmall to MusicPlayerWantsPlayingRepeatStatus_t @@ -20267,10 +16391,9 @@ public static implicit operator MusicPlayerWantsPlayingRepeatStatus_t ( MusicPl } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20383,32 +16506,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTTPRequestCompleted_t { - public const int CallbackId = CallbackIdentifiers.ClientHTTP + 1; - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 + internal const int CallbackId = CallbackIdentifiers.ClientHTTP + 1; + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 [MarshalAs(UnmanagedType.I1)] - public bool RequestSuccessful; // m_bRequestSuccessful _Bool - public HTTPStatusCode StatusCode; // m_eStatusCode enum EHTTPStatusCode - public uint BodySize; // m_unBodySize uint32 + 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. // - public static HTTPRequestCompleted_t FromPointer( IntPtr p ) + 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 { - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 [MarshalAs(UnmanagedType.I1)] - public bool RequestSuccessful; // m_bRequestSuccessful _Bool - public HTTPStatusCode StatusCode; // m_eStatusCode enum EHTTPStatusCode - public uint BodySize; // m_unBodySize uint32 + 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 @@ -20426,10 +16558,9 @@ public static implicit operator HTTPRequestCompleted_t ( HTTPRequestCompleted_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20542,24 +16673,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTTPRequestHeadersReceived_t { - public const int CallbackId = CallbackIdentifiers.ClientHTTP + 2; - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 + 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. // - public static HTTPRequestHeadersReceived_t FromPointer( IntPtr p ) + 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 { - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 // // Easily convert from PackSmall to HTTPRequestHeadersReceived_t @@ -20574,10 +16714,9 @@ public static implicit operator HTTPRequestHeadersReceived_t ( HTTPRequestHeade } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20690,28 +16829,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTTPRequestDataReceived_t { - public const int CallbackId = CallbackIdentifiers.ClientHTTP + 3; - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 - public uint COffset; // m_cOffset uint32 - public uint CBytesReceived; // m_cBytesReceived uint32 + 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. // - public static HTTPRequestDataReceived_t FromPointer( IntPtr p ) + 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 { - public uint Request; // m_hRequest HTTPRequestHandle - public ulong ContextValue; // m_ulContextValue uint64 - public uint COffset; // m_cOffset uint32 - public uint CBytesReceived; // m_cBytesReceived uint32 + 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 @@ -20728,10 +16876,9 @@ public static implicit operator HTTPRequestDataReceived_t ( HTTPRequestDataRece } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -20844,29 +16991,38 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct ControllerAnalogActionData_t { - public ControllerSourceMode EMode; // eMode enum EControllerSourceMode - public float X; // x float - public float Y; // y float + internal ControllerSourceMode EMode; // eMode enum EControllerSourceMode + internal float X; // x float + internal float Y; // y float [MarshalAs(UnmanagedType.I1)] - public bool BActive; // bActive _Bool + internal bool BActive; // bActive _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static ControllerAnalogActionData_t FromPointer( IntPtr p ) + 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 { - public ControllerSourceMode EMode; // eMode enum EControllerSourceMode - public float X; // x float - public float Y; // y float + internal ControllerSourceMode EMode; // eMode enum EControllerSourceMode + internal float X; // x float + internal float Y; // y float [MarshalAs(UnmanagedType.I1)] - public bool BActive; // bActive _Bool + internal bool BActive; // bActive _Bool // // Easily convert from PackSmall to ControllerAnalogActionData_t @@ -20888,26 +17044,35 @@ public static implicit operator ControllerAnalogActionData_t ( ControllerAnalog internal struct ControllerDigitalActionData_t { [MarshalAs(UnmanagedType.I1)] - public bool BState; // bState _Bool + internal bool BState; // bState _Bool [MarshalAs(UnmanagedType.I1)] - public bool BActive; // bActive _Bool + internal bool BActive; // bActive _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static ControllerDigitalActionData_t FromPointer( IntPtr p ) + 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)] - public bool BState; // bState _Bool + internal bool BState; // bState _Bool [MarshalAs(UnmanagedType.I1)] - public bool BActive; // bActive _Bool + internal bool BActive; // bActive _Bool // // Easily convert from PackSmall to ControllerDigitalActionData_t @@ -20926,39 +17091,48 @@ public static implicit operator ControllerDigitalActionData_t ( ControllerDigit [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct ControllerMotionData_t { - 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 + 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. // - public static ControllerMotionData_t FromPointer( IntPtr p ) + 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 { - 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 + 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 @@ -20985,87 +17159,96 @@ public static implicit operator ControllerMotionData_t ( ControllerMotionData_t [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamUGCDetails_t { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult - public WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - public uint CreatorAppID; // m_nCreatorAppID AppId_t - public uint ConsumerAppID; // m_nConsumerAppID AppId_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)] - public string Title; // m_rgchTitle char [129] + internal string Title; // m_rgchTitle char [129] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - public string Description; // m_rgchDescription char [8000] - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - public uint TimeCreated; // m_rtimeCreated uint32 - public uint TimeUpdated; // m_rtimeUpdated uint32 - public uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 - public RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + 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)] - public bool Banned; // m_bBanned _Bool + internal bool Banned; // m_bBanned _Bool [MarshalAs(UnmanagedType.I1)] - public bool AcceptedForUse; // m_bAcceptedForUse _Bool + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool [MarshalAs(UnmanagedType.I1)] - public bool TagsTruncated; // m_bTagsTruncated _Bool + internal bool TagsTruncated; // m_bTagsTruncated _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - public string Tags; // m_rgchTags char [1025] - public ulong File; // m_hFile UGCHandle_t - public ulong PreviewFile; // m_hPreviewFile UGCHandle_t + 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)] - public string PchFileName; // m_pchFileName char [260] - public int FileSize; // m_nFileSize int32 - public int PreviewFileSize; // m_nPreviewFileSize int32 + internal string PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_rgchURL char [256] - public uint VotesUp; // m_unVotesUp uint32 - public uint VotesDown; // m_unVotesDown uint32 - public float Score; // m_flScore float - public uint NumChildren; // m_unNumChildren uint32 + 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. // - public static SteamUGCDetails_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult - public WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - public uint CreatorAppID; // m_nCreatorAppID AppId_t - public uint ConsumerAppID; // m_nConsumerAppID AppId_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)] - public string Title; // m_rgchTitle char [129] + internal string Title; // m_rgchTitle char [129] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - public string Description; // m_rgchDescription char [8000] - public ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - public uint TimeCreated; // m_rtimeCreated uint32 - public uint TimeUpdated; // m_rtimeUpdated uint32 - public uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 - public RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + 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)] - public bool Banned; // m_bBanned _Bool + internal bool Banned; // m_bBanned _Bool [MarshalAs(UnmanagedType.I1)] - public bool AcceptedForUse; // m_bAcceptedForUse _Bool + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool [MarshalAs(UnmanagedType.I1)] - public bool TagsTruncated; // m_bTagsTruncated _Bool + internal bool TagsTruncated; // m_bTagsTruncated _Bool [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - public string Tags; // m_rgchTags char [1025] - public ulong File; // m_hFile UGCHandle_t - public ulong PreviewFile; // m_hPreviewFile UGCHandle_t + 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)] - public string PchFileName; // m_pchFileName char [260] - public int FileSize; // m_nFileSize int32 - public int PreviewFileSize; // m_nPreviewFileSize int32 + internal string PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_rgchURL char [256] - public uint VotesUp; // m_unVotesUp uint32 - public uint VotesDown; // m_unVotesDown uint32 - public float Score; // m_flScore float - public uint NumChildren; // m_unNumChildren uint32 + 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 @@ -21108,32 +17291,41 @@ public static implicit operator SteamUGCDetails_t ( SteamUGCDetails_t.PackSmall [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamUGCQueryCompleted_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 1; - public ulong Handle; // m_handle UGCQueryHandle_t - public Result Result; // m_eResult enum EResult - public uint NumResultsReturned; // m_unNumResultsReturned uint32 - public uint TotalMatchingResults; // m_unTotalMatchingResults uint32 + 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)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SteamUGCQueryCompleted_t FromPointer( IntPtr p ) + 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 { - public ulong Handle; // m_handle UGCQueryHandle_t - public Result Result; // m_eResult enum EResult - public uint NumResultsReturned; // m_unNumResultsReturned uint32 - public uint TotalMatchingResults; // m_unTotalMatchingResults uint32 + 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)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Easily convert from PackSmall to SteamUGCQueryCompleted_t @@ -21151,140 +17343,14 @@ public static implicit operator SteamUGCQueryCompleted_t ( SteamUGCQueryComplet } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamUGCQueryCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamUGCQueryCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -21397,26 +17463,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamUGCRequestUGCDetailsResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 2; - public SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t + internal const int CallbackId = CallbackIdentifiers.ClientUGC + 2; + internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t [MarshalAs(UnmanagedType.I1)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SteamUGCRequestUGCDetailsResult_t FromPointer( IntPtr p ) + 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 { - public SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t + internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t [MarshalAs(UnmanagedType.I1)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Easily convert from PackSmall to SteamUGCRequestUGCDetailsResult_t @@ -21431,10 +17506,9 @@ public static implicit operator SteamUGCRequestUGCDetailsResult_t ( SteamUGCReq } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -21547,28 +17621,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct CreateItemResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 3; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static CreateItemResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t [MarshalAs(UnmanagedType.I1)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool // // Easily convert from PackSmall to CreateItemResult_t @@ -21584,140 +17667,14 @@ public static implicit operator CreateItemResult_t ( CreateItemResult_t.PackSma } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( CreateItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( CreateItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -21830,28 +17787,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SubmitItemUpdateResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 4; - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.ClientUGC + 4; + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + 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. // - public static SubmitItemUpdateResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to SubmitItemUpdateResult_t @@ -21867,140 +17833,14 @@ public static implicit operator SubmitItemUpdateResult_t ( SubmitItemUpdateResu } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SubmitItemUpdateResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SubmitItemUpdateResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -22113,26 +17953,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct DownloadItemResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 6; - public uint AppID; // m_unAppID AppId_t - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + 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. // - public static DownloadItemResult_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_unAppID AppId_t - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + 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 @@ -22148,10 +17997,9 @@ public static implicit operator DownloadItemResult_t ( DownloadItemResult_t.Pac } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -22264,28 +18112,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct UserFavoriteItemsListChanged_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 7; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.ClientUGC + 7; + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool WasAddRequest; // m_bWasAddRequest _Bool + internal bool WasAddRequest; // m_bWasAddRequest _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static UserFavoriteItemsListChanged_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool WasAddRequest; // m_bWasAddRequest _Bool + internal bool WasAddRequest; // m_bWasAddRequest _Bool // // Easily convert from PackSmall to UserFavoriteItemsListChanged_t @@ -22301,140 +18158,14 @@ public static implicit operator UserFavoriteItemsListChanged_t ( UserFavoriteIt } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserFavoriteItemsListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserFavoriteItemsListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -22547,28 +18278,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SetUserItemVoteResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 8; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.ClientUGC + 8; + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool VoteUp; // m_bVoteUp _Bool + internal bool VoteUp; // m_bVoteUp _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SetUserItemVoteResult_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool VoteUp; // m_bVoteUp _Bool + internal bool VoteUp; // m_bVoteUp _Bool // // Easily convert from PackSmall to SetUserItemVoteResult_t @@ -22584,140 +18324,14 @@ public static implicit operator SetUserItemVoteResult_t ( SetUserItemVoteResult } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -22830,36 +18444,45 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GetUserItemVoteResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 9; - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal const int CallbackId = CallbackIdentifiers.ClientUGC + 9; + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool VotedUp; // m_bVotedUp _Bool + internal bool VotedUp; // m_bVotedUp _Bool [MarshalAs(UnmanagedType.I1)] - public bool VotedDown; // m_bVotedDown _Bool + internal bool VotedDown; // m_bVotedDown _Bool [MarshalAs(UnmanagedType.I1)] - public bool VoteSkipped; // m_bVoteSkipped _Bool + internal bool VoteSkipped; // m_bVoteSkipped _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GetUserItemVoteResult_t FromPointer( IntPtr p ) + 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 { - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] - public bool VotedUp; // m_bVotedUp _Bool + internal bool VotedUp; // m_bVotedUp _Bool [MarshalAs(UnmanagedType.I1)] - public bool VotedDown; // m_bVotedDown _Bool + internal bool VotedDown; // m_bVotedDown _Bool [MarshalAs(UnmanagedType.I1)] - public bool VoteSkipped; // m_bVoteSkipped _Bool + internal bool VoteSkipped; // m_bVoteSkipped _Bool // // Easily convert from PackSmall to GetUserItemVoteResult_t @@ -22877,140 +18500,14 @@ public static implicit operator GetUserItemVoteResult_t ( GetUserItemVoteResult } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -23123,22 +18620,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct StartPlaytimeTrackingResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 10; - public Result Result; // m_eResult enum EResult + 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. // - public static StartPlaytimeTrackingResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to StartPlaytimeTrackingResult_t @@ -23152,140 +18658,14 @@ public static implicit operator StartPlaytimeTrackingResult_t ( StartPlaytimeTr } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StartPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StartPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -23398,22 +18778,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct StopPlaytimeTrackingResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 11; - public Result Result; // m_eResult enum EResult + 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. // - public static StopPlaytimeTrackingResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to StopPlaytimeTrackingResult_t @@ -23427,140 +18816,14 @@ public static implicit operator StopPlaytimeTrackingResult_t ( StopPlaytimeTrac } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StopPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StopPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -23673,26 +18936,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct AddUGCDependencyResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 12; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_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. // - public static AddUGCDependencyResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + 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 @@ -23708,140 +18980,14 @@ public static implicit operator AddUGCDependencyResult_t ( AddUGCDependencyResu } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AddUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AddUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -23954,26 +19100,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoveUGCDependencyResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 13; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_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. // - public static RemoveUGCDependencyResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + 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 @@ -23989,140 +19144,14 @@ public static implicit operator RemoveUGCDependencyResult_t ( RemoveUGCDependen } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoveUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoveUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -24235,26 +19264,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct AddAppDependencyResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 14; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_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. // - public static AddAppDependencyResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t + 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 @@ -24270,140 +19308,14 @@ public static implicit operator AddAppDependencyResult_t ( AddAppDependencyResu } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AddAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AddAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -24516,26 +19428,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct RemoveAppDependencyResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 15; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_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. // - public static RemoveAppDependencyResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - public uint AppID; // m_nAppID AppId_t + 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 @@ -24551,140 +19472,14 @@ public static implicit operator RemoveAppDependencyResult_t ( RemoveAppDependen } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoveAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoveAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -24797,32 +19592,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GetAppDependenciesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 16; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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)] - public AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32] - public uint NumAppDependencies; // m_nNumAppDependencies uint32 - public uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 + 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. // - public static GetAppDependenciesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)] - public AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32] - public uint NumAppDependencies; // m_nNumAppDependencies uint32 - public uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 + 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 @@ -24840,140 +19644,14 @@ public static implicit operator GetAppDependenciesResult_t ( GetAppDependencies } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetAppDependenciesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetAppDependenciesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -25086,24 +19764,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct DeleteItemResult_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 17; - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static DeleteItemResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to DeleteItemResult_t @@ -25118,140 +19805,14 @@ public static implicit operator DeleteItemResult_t ( DeleteItemResult_t.PackSma } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( DeleteItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( DeleteItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -25364,22 +19925,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamAppInstalled_t { - public const int CallbackId = CallbackIdentifiers.SteamAppList + 1; - public uint AppID; // m_nAppID AppId_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. // - public static SteamAppInstalled_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to SteamAppInstalled_t @@ -25393,10 +19963,9 @@ public static implicit operator SteamAppInstalled_t ( SteamAppInstalled_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -25509,22 +20078,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamAppUninstalled_t { - public const int CallbackId = CallbackIdentifiers.SteamAppList + 2; - public uint AppID; // m_nAppID AppId_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. // - public static SteamAppUninstalled_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_nAppID AppId_t + internal uint AppID; // m_nAppID AppId_t // // Easily convert from PackSmall to SteamAppUninstalled_t @@ -25538,10 +20116,9 @@ public static implicit operator SteamAppUninstalled_t ( SteamAppUninstalled_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -25654,22 +20231,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_BrowserReady_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 1; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + 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. // - public static HTML_BrowserReady_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser // // Easily convert from PackSmall to HTML_BrowserReady_t @@ -25683,140 +20269,14 @@ public static implicit operator HTML_BrowserReady_t ( HTML_BrowserReady_t.PackS } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_BrowserReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_BrowserReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -25929,43 +20389,52 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_NeedsPaint_t { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PBGRA; // pBGRA const char * - public uint UnWide; // unWide uint32 - public uint UnTall; // unTall uint32 - public uint UnUpdateX; // unUpdateX uint32 - public uint UnUpdateY; // unUpdateY uint32 - public uint UnUpdateWide; // unUpdateWide uint32 - public uint UnUpdateTall; // unUpdateTall uint32 - public uint UnScrollX; // unScrollX uint32 - public uint UnScrollY; // unScrollY uint32 - public float FlPageScale; // flPageScale float - public uint UnPageSerial; // unPageSerial uint32 + 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. // - public static HTML_NeedsPaint_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PBGRA; // pBGRA const char * - public uint UnWide; // unWide uint32 - public uint UnTall; // unTall uint32 - public uint UnUpdateX; // unUpdateX uint32 - public uint UnUpdateY; // unUpdateY uint32 - public uint UnUpdateWide; // unUpdateWide uint32 - public uint UnUpdateTall; // unUpdateTall uint32 - public uint UnScrollX; // unScrollX uint32 - public uint UnScrollY; // unScrollY uint32 - public float FlPageScale; // flPageScale float - public uint UnPageSerial; // unPageSerial uint32 + 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 @@ -25994,31 +20463,40 @@ public static implicit operator HTML_NeedsPaint_t ( HTML_NeedsPaint_t.PackSmall [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_StartRequest_t { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchTarget; // pchTarget const char * - public string PchPostData; // pchPostData const char * + 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)] - public bool BIsRedirect; // bIsRedirect _Bool + internal bool BIsRedirect; // bIsRedirect _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static HTML_StartRequest_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchTarget; // pchTarget const char * - public string PchPostData; // pchPostData const char * + 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)] - public bool BIsRedirect; // bIsRedirect _Bool + internal bool BIsRedirect; // bIsRedirect _Bool // // Easily convert from PackSmall to HTML_StartRequest_t @@ -26040,21 +20518,30 @@ public static implicit operator HTML_StartRequest_t ( HTML_StartRequest_t.PackS [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_CloseBrowser_t { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static HTML_CloseBrowser_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser // // Easily convert from PackSmall to HTML_CloseBrowser_t @@ -26072,36 +20559,45 @@ public static implicit operator HTML_CloseBrowser_t ( HTML_CloseBrowser_t.PackS [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_URLChanged_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 5; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchPostData; // pchPostData const char * + 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)] - public bool BIsRedirect; // bIsRedirect _Bool - public string PchPageTitle; // pchPageTitle const char * + internal bool BIsRedirect; // bIsRedirect _Bool + internal string PchPageTitle; // pchPageTitle const char * [MarshalAs(UnmanagedType.I1)] - public bool BNewNavigation; // bNewNavigation _Bool + internal bool BNewNavigation; // bNewNavigation _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static HTML_URLChanged_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchPostData; // pchPostData const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchPostData; // pchPostData const char * [MarshalAs(UnmanagedType.I1)] - public bool BIsRedirect; // bIsRedirect _Bool - public string PchPageTitle; // pchPageTitle const char * + internal bool BIsRedirect; // bIsRedirect _Bool + internal string PchPageTitle; // pchPageTitle const char * [MarshalAs(UnmanagedType.I1)] - public bool BNewNavigation; // bNewNavigation _Bool + internal bool BNewNavigation; // bNewNavigation _Bool // // Easily convert from PackSmall to HTML_URLChanged_t @@ -26120,10 +20616,9 @@ public static implicit operator HTML_URLChanged_t ( HTML_URLChanged_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26236,26 +20731,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_FinishedRequest_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 6; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchPageTitle; // pchPageTitle const char * + 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. // - public static HTML_FinishedRequest_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public string PchPageTitle; // pchPageTitle const char * + 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 @@ -26271,10 +20775,9 @@ public static implicit operator HTML_FinishedRequest_t ( HTML_FinishedRequest_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26387,24 +20890,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_OpenLinkInNewTab_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 7; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * + 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. // - public static HTML_OpenLinkInNewTab_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * // // Easily convert from PackSmall to HTML_OpenLinkInNewTab_t @@ -26419,10 +20931,9 @@ public static implicit operator HTML_OpenLinkInNewTab_t ( HTML_OpenLinkInNewTab } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26535,24 +21046,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_ChangedTitle_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 8; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchTitle; // pchTitle const char * + 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. // - public static HTML_ChangedTitle_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchTitle; // pchTitle const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchTitle; // pchTitle const char * // // Easily convert from PackSmall to HTML_ChangedTitle_t @@ -26567,10 +21087,9 @@ public static implicit operator HTML_ChangedTitle_t ( HTML_ChangedTitle_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26683,26 +21202,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_SearchResults_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 9; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnResults; // unResults uint32 - public uint UnCurrentMatch; // unCurrentMatch uint32 + 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. // - public static HTML_SearchResults_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnResults; // unResults uint32 - public uint UnCurrentMatch; // unCurrentMatch uint32 + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnResults; // unResults uint32 + internal uint UnCurrentMatch; // unCurrentMatch uint32 // // Easily convert from PackSmall to HTML_SearchResults_t @@ -26718,10 +21246,9 @@ public static implicit operator HTML_SearchResults_t ( HTML_SearchResults_t.Pac } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26834,30 +21361,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_CanGoBackAndForward_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 10; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 10; + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser [MarshalAs(UnmanagedType.I1)] - public bool BCanGoBack; // bCanGoBack _Bool + internal bool BCanGoBack; // bCanGoBack _Bool [MarshalAs(UnmanagedType.I1)] - public bool BCanGoForward; // bCanGoForward _Bool + internal bool BCanGoForward; // bCanGoForward _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static HTML_CanGoBackAndForward_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser [MarshalAs(UnmanagedType.I1)] - public bool BCanGoBack; // bCanGoBack _Bool + internal bool BCanGoBack; // bCanGoBack _Bool [MarshalAs(UnmanagedType.I1)] - public bool BCanGoForward; // bCanGoForward _Bool + internal bool BCanGoForward; // bCanGoForward _Bool // // Easily convert from PackSmall to HTML_CanGoBackAndForward_t @@ -26873,10 +21409,9 @@ public static implicit operator HTML_CanGoBackAndForward_t ( HTML_CanGoBackAndF } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -26989,34 +21524,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_HorizontalScroll_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 11; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnScrollMax; // unScrollMax uint32 - public uint UnScrollCurrent; // unScrollCurrent uint32 - public float FlPageScale; // flPageScale float + 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)] - public bool BVisible; // bVisible _Bool - public uint UnPageSize; // unPageSize uint32 + 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. // - public static HTML_HorizontalScroll_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnScrollMax; // unScrollMax uint32 - public uint UnScrollCurrent; // unScrollCurrent uint32 - public float FlPageScale; // flPageScale float + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float [MarshalAs(UnmanagedType.I1)] - public bool BVisible; // bVisible _Bool - public uint UnPageSize; // unPageSize uint32 + internal bool BVisible; // bVisible _Bool + internal uint UnPageSize; // unPageSize uint32 // // Easily convert from PackSmall to HTML_HorizontalScroll_t @@ -27035,10 +21579,9 @@ public static implicit operator HTML_HorizontalScroll_t ( HTML_HorizontalScroll } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27151,34 +21694,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_VerticalScroll_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 12; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnScrollMax; // unScrollMax uint32 - public uint UnScrollCurrent; // unScrollCurrent uint32 - public float FlPageScale; // flPageScale float + 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)] - public bool BVisible; // bVisible _Bool - public uint UnPageSize; // unPageSize uint32 + 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. // - public static HTML_VerticalScroll_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnScrollMax; // unScrollMax uint32 - public uint UnScrollCurrent; // unScrollCurrent uint32 - public float FlPageScale; // flPageScale float + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float [MarshalAs(UnmanagedType.I1)] - public bool BVisible; // bVisible _Bool - public uint UnPageSize; // unPageSize uint32 + internal bool BVisible; // bVisible _Bool + internal uint UnPageSize; // unPageSize uint32 // // Easily convert from PackSmall to HTML_VerticalScroll_t @@ -27197,10 +21749,9 @@ public static implicit operator HTML_VerticalScroll_t ( HTML_VerticalScroll_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27313,36 +21864,45 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_LinkAtPosition_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 13; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint X; // x uint32 - public uint Y; // y uint32 - public string PchURL; // pchURL const char * + 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)] - public bool BInput; // bInput _Bool + internal bool BInput; // bInput _Bool [MarshalAs(UnmanagedType.I1)] - public bool BLiveLink; // bLiveLink _Bool + internal bool BLiveLink; // bLiveLink _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static HTML_LinkAtPosition_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint X; // x uint32 - public uint Y; // y uint32 - public string PchURL; // pchURL const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint X; // x uint32 + internal uint Y; // y uint32 + internal string PchURL; // pchURL const char * [MarshalAs(UnmanagedType.I1)] - public bool BInput; // bInput _Bool + internal bool BInput; // bInput _Bool [MarshalAs(UnmanagedType.I1)] - public bool BLiveLink; // bLiveLink _Bool + internal bool BLiveLink; // bLiveLink _Bool // // Easily convert from PackSmall to HTML_LinkAtPosition_t @@ -27361,10 +21921,9 @@ public static implicit operator HTML_LinkAtPosition_t ( HTML_LinkAtPosition_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27477,24 +22036,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_JSAlert_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 14; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMessage; // pchMessage const char * + 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. // - public static HTML_JSAlert_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMessage; // pchMessage const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * // // Easily convert from PackSmall to HTML_JSAlert_t @@ -27509,10 +22077,9 @@ public static implicit operator HTML_JSAlert_t ( HTML_JSAlert_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27625,24 +22192,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_JSConfirm_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 15; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMessage; // pchMessage const char * + 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. // - public static HTML_JSConfirm_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMessage; // pchMessage const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * // // Easily convert from PackSmall to HTML_JSConfirm_t @@ -27657,10 +22233,9 @@ public static implicit operator HTML_JSConfirm_t ( HTML_JSConfirm_t.PackSmall d } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27773,26 +22348,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_FileOpenDialog_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 16; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchTitle; // pchTitle const char * - public string PchInitialFile; // pchInitialFile const char * + 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. // - public static HTML_FileOpenDialog_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchTitle; // pchTitle const char * - public string PchInitialFile; // pchInitialFile const char * + 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 @@ -27808,10 +22392,9 @@ public static implicit operator HTML_FileOpenDialog_t ( HTML_FileOpenDialog_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -27924,34 +22507,43 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_NewWindow_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 21; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public uint UnX; // unX uint32 - public uint UnY; // unY uint32 - public uint UnWide; // unWide uint32 - public uint UnTall; // unTall uint32 - public uint UnNewWindow_BrowserHandle; // unNewWindow_BrowserHandle HHTMLBrowser + 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. // - public static HTML_NewWindow_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchURL; // pchURL const char * - public uint UnX; // unX uint32 - public uint UnY; // unY uint32 - public uint UnWide; // unWide uint32 - public uint UnTall; // unTall uint32 - public uint UnNewWindow_BrowserHandle; // unNewWindow_BrowserHandle HHTMLBrowser + 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 @@ -27971,10 +22563,9 @@ public static implicit operator HTML_NewWindow_t ( HTML_NewWindow_t.PackSmall d } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28087,24 +22678,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_SetCursor_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 22; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint EMouseCursor; // eMouseCursor uint32 + 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. // - public static HTML_SetCursor_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint EMouseCursor; // eMouseCursor uint32 + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint EMouseCursor; // eMouseCursor uint32 // // Easily convert from PackSmall to HTML_SetCursor_t @@ -28119,10 +22719,9 @@ public static implicit operator HTML_SetCursor_t ( HTML_SetCursor_t.PackSmall d } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28235,24 +22834,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_StatusText_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 23; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + 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. // - public static HTML_StatusText_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * // // Easily convert from PackSmall to HTML_StatusText_t @@ -28267,10 +22875,9 @@ public static implicit operator HTML_StatusText_t ( HTML_StatusText_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28383,24 +22990,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_ShowToolTip_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 24; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + 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. // - public static HTML_ShowToolTip_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * // // Easily convert from PackSmall to HTML_ShowToolTip_t @@ -28415,10 +23031,9 @@ public static implicit operator HTML_ShowToolTip_t ( HTML_ShowToolTip_t.PackSma } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28531,24 +23146,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_UpdateToolTip_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 25; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + 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. // - public static HTML_UpdateToolTip_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public string PchMsg; // pchMsg const char * + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * // // Easily convert from PackSmall to HTML_UpdateToolTip_t @@ -28563,10 +23187,9 @@ public static implicit operator HTML_UpdateToolTip_t ( HTML_UpdateToolTip_t.Pac } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28679,22 +23302,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_HideToolTip_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 26; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + 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. // - public static HTML_HideToolTip_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser // // Easily convert from PackSmall to HTML_HideToolTip_t @@ -28708,10 +23340,9 @@ public static implicit operator HTML_HideToolTip_t ( HTML_HideToolTip_t.PackSma } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28824,24 +23455,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct HTML_BrowserRestarted_t { - public const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 27; - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser + 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. // - public static HTML_BrowserRestarted_t FromPointer( IntPtr p ) + 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 { - public uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - public uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser // // Easily convert from PackSmall to HTML_BrowserRestarted_t @@ -28856,10 +23496,9 @@ public static implicit operator HTML_BrowserRestarted_t ( HTML_BrowserRestarted } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -28972,27 +23611,36 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamItemDetails_t { - public ulong ItemId; // m_itemId SteamItemInstanceID_t - public int Definition; // m_iDefinition SteamItemDef_t - public ushort Quantity; // m_unQuantity uint16 - public ushort Flags; // m_unFlags uint16 + 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. // - public static SteamItemDetails_t FromPointer( IntPtr p ) + 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 { - public ulong ItemId; // m_itemId SteamItemInstanceID_t - public int Definition; // m_iDefinition SteamItemDef_t - public ushort Quantity; // m_unQuantity uint16 - public ushort Flags; // m_unFlags uint16 + 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 @@ -29013,24 +23661,33 @@ public static implicit operator SteamItemDetails_t ( SteamItemDetails_t.PackSma [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamInventoryResultReady_t { - public const int CallbackId = CallbackIdentifiers.ClientInventory + 0; - public int Handle; // m_handle SteamInventoryResult_t - public Result Result; // m_result enum EResult + 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. // - public static SteamInventoryResultReady_t FromPointer( IntPtr p ) + 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 { - public int Handle; // m_handle SteamInventoryResult_t - public Result Result; // m_result enum EResult + internal int Handle; // m_handle SteamInventoryResult_t + internal Result Result; // m_result enum EResult // // Easily convert from PackSmall to SteamInventoryResultReady_t @@ -29045,10 +23702,9 @@ public static implicit operator SteamInventoryResultReady_t ( SteamInventoryRes } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -29161,22 +23817,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamInventoryFullUpdate_t { - public const int CallbackId = CallbackIdentifiers.ClientInventory + 1; - public int Handle; // m_handle SteamInventoryResult_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. // - public static SteamInventoryFullUpdate_t FromPointer( IntPtr p ) + 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 { - public int Handle; // m_handle SteamInventoryResult_t + internal int Handle; // m_handle SteamInventoryResult_t // // Easily convert from PackSmall to SteamInventoryFullUpdate_t @@ -29190,10 +23855,9 @@ public static implicit operator SteamInventoryFullUpdate_t ( SteamInventoryFull } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -29306,30 +23970,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct SteamInventoryEligiblePromoItemDefIDs_t { - public const int CallbackId = CallbackIdentifiers.ClientInventory + 3; - public Result Result; // m_result enum EResult - public ulong SteamID; // m_steamID class CSteamID - public int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int + 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)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SteamInventoryEligiblePromoItemDefIDs_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_result enum EResult - public ulong SteamID; // m_steamID class CSteamID - public int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int + internal Result Result; // m_result enum EResult + internal ulong SteamID; // m_steamID class CSteamID + internal int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int [MarshalAs(UnmanagedType.I1)] - public bool CachedData; // m_bCachedData _Bool + internal bool CachedData; // m_bCachedData _Bool // // Easily convert from PackSmall to SteamInventoryEligiblePromoItemDefIDs_t @@ -29346,140 +24019,14 @@ public static implicit operator SteamInventoryEligiblePromoItemDefIDs_t ( Steam } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryEligiblePromoItemDefIDs_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryEligiblePromoItemDefIDs_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -29592,26 +24139,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamInventoryStartPurchaseResult_t { - public const int CallbackId = CallbackIdentifiers.ClientInventory + 4; - public Result Result; // m_result enum EResult - public ulong OrderID; // m_ulOrderID uint64 - public ulong TransID; // m_ulTransID uint64 + 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. // - public static SteamInventoryStartPurchaseResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_result enum EResult - public ulong OrderID; // m_ulOrderID uint64 - public ulong TransID; // m_ulTransID uint64 + 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 @@ -29627,140 +24183,14 @@ public static implicit operator SteamInventoryStartPurchaseResult_t ( SteamInve } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryStartPurchaseResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryStartPurchaseResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -29873,26 +24303,35 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct SteamInventoryRequestPricesResult_t { - public const int CallbackId = CallbackIdentifiers.ClientInventory + 5; - public Result Result; // m_result enum EResult + internal const int CallbackId = CallbackIdentifiers.ClientInventory + 5; + internal Result Result; // m_result enum EResult [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - public string Currency; // m_rgchCurrency char [4] + internal string Currency; // m_rgchCurrency char [4] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static SteamInventoryRequestPricesResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_result enum EResult + internal Result Result; // m_result enum EResult [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - public string Currency; // m_rgchCurrency char [4] + internal string Currency; // m_rgchCurrency char [4] // // Easily convert from PackSmall to SteamInventoryRequestPricesResult_t @@ -29907,140 +24346,14 @@ public static implicit operator SteamInventoryRequestPricesResult_t ( SteamInve } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryRequestPricesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryRequestPricesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30153,22 +24466,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct BroadcastUploadStop_t { - public const int CallbackId = CallbackIdentifiers.ClientVideo + 5; - public BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult + 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. // - public static BroadcastUploadStop_t FromPointer( IntPtr p ) + 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 { - public BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult + internal BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult // // Easily convert from PackSmall to BroadcastUploadStop_t @@ -30182,10 +24504,9 @@ public static implicit operator BroadcastUploadStop_t ( BroadcastUploadStop_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30298,28 +24619,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GetVideoURLResult_t { - public const int CallbackId = CallbackIdentifiers.ClientVideo + 11; - public Result Result; // m_eResult enum EResult - public uint VideoAppID; // m_unVideoAppID AppId_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)] - public string URL; // m_rgchURL char [256] + internal string URL; // m_rgchURL char [256] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GetVideoURLResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public uint VideoAppID; // m_unVideoAppID AppId_t + internal Result Result; // m_eResult enum EResult + internal uint VideoAppID; // m_unVideoAppID AppId_t [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string URL; // m_rgchURL char [256] + internal string URL; // m_rgchURL char [256] // // Easily convert from PackSmall to GetVideoURLResult_t @@ -30335,10 +24665,9 @@ public static implicit operator GetVideoURLResult_t ( GetVideoURLResult_t.PackS } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30451,24 +24780,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GetOPFSettingsResult_t { - public const int CallbackId = CallbackIdentifiers.ClientVideo + 24; - public Result Result; // m_eResult enum EResult - public uint VideoAppID; // m_unVideoAppID AppId_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. // - public static GetOPFSettingsResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public uint VideoAppID; // m_unVideoAppID AppId_t + internal Result Result; // m_eResult enum EResult + internal uint VideoAppID; // m_unVideoAppID AppId_t // // Easily convert from PackSmall to GetOPFSettingsResult_t @@ -30483,10 +24821,9 @@ public static implicit operator GetOPFSettingsResult_t ( GetOPFSettingsResult_t } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30599,24 +24936,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSClientApprove_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 1; - public ulong SteamID; // m_SteamID class CSteamID - public ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + 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. // - public static GSClientApprove_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_SteamID class CSteamID - public ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + internal ulong SteamID; // m_SteamID class CSteamID + internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID // // Easily convert from PackSmall to GSClientApprove_t @@ -30631,10 +24977,9 @@ public static implicit operator GSClientApprove_t ( GSClientApprove_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30747,28 +25092,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSClientDeny_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 2; - public ulong SteamID; // m_SteamID class CSteamID - public DenyReason DenyReason; // m_eDenyReason enum EDenyReason + 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)] - public string OptionalText; // m_rgchOptionalText char [128] + internal string OptionalText; // m_rgchOptionalText char [128] // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GSClientDeny_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_SteamID class CSteamID - public DenyReason DenyReason; // m_eDenyReason enum EDenyReason + internal ulong SteamID; // m_SteamID class CSteamID + internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string OptionalText; // m_rgchOptionalText char [128] + internal string OptionalText; // m_rgchOptionalText char [128] // // Easily convert from PackSmall to GSClientDeny_t @@ -30784,10 +25138,9 @@ public static implicit operator GSClientDeny_t ( GSClientDeny_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -30900,24 +25253,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSClientKick_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 3; - public ulong SteamID; // m_SteamID class CSteamID - public DenyReason DenyReason; // m_eDenyReason enum EDenyReason + 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. // - public static GSClientKick_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_SteamID class CSteamID - public DenyReason DenyReason; // m_eDenyReason enum EDenyReason + internal ulong SteamID; // m_SteamID class CSteamID + internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason // // Easily convert from PackSmall to GSClientKick_t @@ -30932,10 +25294,9 @@ public static implicit operator GSClientKick_t ( GSClientKick_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31048,30 +25409,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GSClientAchievementStatus_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 6; - public ulong SteamID; // m_SteamID uint64 + internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 6; + internal ulong SteamID; // m_SteamID uint64 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string PchAchievement; // m_pchAchievement char [128] + internal string PchAchievement; // m_pchAchievement char [128] [MarshalAs(UnmanagedType.I1)] - public bool Unlocked; // m_bUnlocked _Bool + internal bool Unlocked; // m_bUnlocked _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GSClientAchievementStatus_t FromPointer( IntPtr p ) + 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 { - public ulong SteamID; // m_SteamID uint64 + internal ulong SteamID; // m_SteamID uint64 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string PchAchievement; // m_pchAchievement char [128] + internal string PchAchievement; // m_pchAchievement char [128] [MarshalAs(UnmanagedType.I1)] - public bool Unlocked; // m_bUnlocked _Bool + internal bool Unlocked; // m_bUnlocked _Bool // // Easily convert from PackSmall to GSClientAchievementStatus_t @@ -31087,10 +25457,9 @@ public static implicit operator GSClientAchievementStatus_t ( GSClientAchieveme } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31203,22 +25572,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GSPolicyResponse_t { - public const int CallbackId = CallbackIdentifiers.SteamUser + 15; - public byte Secure; // m_bSecure uint8 + 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. // - public static GSPolicyResponse_t FromPointer( IntPtr p ) + 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 { - public byte Secure; // m_bSecure uint8 + internal byte Secure; // m_bSecure uint8 // // Easily convert from PackSmall to GSPolicyResponse_t @@ -31232,10 +25610,9 @@ public static implicit operator GSPolicyResponse_t ( GSPolicyResponse_t.PackSma } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31348,28 +25725,37 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GSGameplayStats_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 7; - public Result Result; // m_eResult enum EResult - public int Rank; // m_nRank int32 - public uint TotalConnects; // m_unTotalConnects uint32 - public uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 + 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. // - public static GSGameplayStats_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int Rank; // m_nRank int32 - public uint TotalConnects; // m_unTotalConnects uint32 - public uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 + 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 @@ -31386,10 +25772,9 @@ public static implicit operator GSGameplayStats_t ( GSGameplayStats_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31502,32 +25887,41 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSClientGroupStatus_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 8; - public ulong SteamIDUser; // m_SteamIDUser class CSteamID - public ulong SteamIDGroup; // m_SteamIDGroup class CSteamID + internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 8; + internal ulong SteamIDUser; // m_SteamIDUser class CSteamID + internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool Member; // m_bMember _Bool + internal bool Member; // m_bMember _Bool [MarshalAs(UnmanagedType.I1)] - public bool Officer; // m_bOfficer _Bool + internal bool Officer; // m_bOfficer _Bool // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. // - public static GSClientGroupStatus_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_SteamIDUser class CSteamID - public ulong SteamIDGroup; // m_SteamIDGroup class CSteamID + internal ulong SteamIDUser; // m_SteamIDUser class CSteamID + internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID [MarshalAs(UnmanagedType.I1)] - public bool Member; // m_bMember _Bool + internal bool Member; // m_bMember _Bool [MarshalAs(UnmanagedType.I1)] - public bool Officer; // m_bOfficer _Bool + internal bool Officer; // m_bOfficer _Bool // // Easily convert from PackSmall to GSClientGroupStatus_t @@ -31544,10 +25938,9 @@ public static implicit operator GSClientGroupStatus_t ( GSClientGroupStatus_t.P } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31660,36 +26053,45 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct GSReputation_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 9; - public Result Result; // m_eResult enum EResult - public uint ReputationScore; // m_unReputationScore uint32 + internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 9; + internal Result Result; // m_eResult enum EResult + internal uint ReputationScore; // m_unReputationScore uint32 [MarshalAs(UnmanagedType.I1)] - public bool Banned; // m_bBanned _Bool - public uint BannedIP; // m_unBannedIP uint32 - public ushort BannedPort; // m_usBannedPort uint16 - public ulong BannedGameID; // m_ulBannedGameID uint64 - public uint BanExpires; // m_unBanExpires uint32 + 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. // - public static GSReputation_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public uint ReputationScore; // m_unReputationScore uint32 + internal Result Result; // m_eResult enum EResult + internal uint ReputationScore; // m_unReputationScore uint32 [MarshalAs(UnmanagedType.I1)] - public bool Banned; // m_bBanned _Bool - public uint BannedIP; // m_unBannedIP uint32 - public ushort BannedPort; // m_usBannedPort uint16 - public ulong BannedGameID; // m_ulBannedGameID uint64 - public uint BanExpires; // m_unBanExpires uint32 + 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 @@ -31709,140 +26111,14 @@ public static implicit operator GSReputation_t ( GSReputation_t.PackSmall d ) } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSReputation_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSReputation_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -31955,22 +26231,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct AssociateWithClanResult_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 10; - public Result Result; // m_eResult enum EResult + 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. // - public static AssociateWithClanResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult + internal Result Result; // m_eResult enum EResult // // Easily convert from PackSmall to AssociateWithClanResult_t @@ -31984,140 +26269,14 @@ public static implicit operator AssociateWithClanResult_t ( AssociateWithClanRe } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AssociateWithClanResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AssociateWithClanResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -32230,30 +26389,39 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct ComputeNewPlayerCompatibilityResult_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServer + 11; - public Result Result; // m_eResult enum EResult - public int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int - public int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int - public int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int - public ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID + 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. // - public static ComputeNewPlayerCompatibilityResult_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int - public int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int - public int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int - public ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID + 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 @@ -32271,140 +26439,14 @@ public static implicit operator ComputeNewPlayerCompatibilityResult_t ( Compute } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ComputeNewPlayerCompatibilityResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ComputeNewPlayerCompatibilityResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -32517,24 +26559,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSStatsReceived_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServerStats + 0; - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static GSStatsReceived_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDUser; // m_steamIDUser class CSteamID // // Easily convert from PackSmall to GSStatsReceived_t @@ -32549,140 +26600,14 @@ public static implicit operator GSStatsReceived_t ( GSStatsReceived_t.PackSmall } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -32795,24 +26720,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSStatsStored_t { - public const int CallbackId = CallbackIdentifiers.SteamGameServerStats + 1; - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static GSStatsStored_t FromPointer( IntPtr p ) + 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 { - public Result Result; // m_eResult enum EResult - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDUser; // m_steamIDUser class CSteamID // // Easily convert from PackSmall to GSStatsStored_t @@ -32827,140 +26761,14 @@ public static implicit operator GSStatsStored_t ( GSStatsStored_t.PackSmall d ) } } - public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) + internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; - handle.CallResultHandle = call; - handle.CallResult = true; - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - Callback.ThisCall.Result funcA = ( _, p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - Callback.StdCall.Result funcA = ( p ) => { handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => - { - if ( hSteamAPICall != call ) return; - - handle.CallResultHandle = 0; - handle.Dispose(); - - CallbackFunction( FromPointer( p ), bIOFailure ); - }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - - // - // Create the VTable by manually allocating the memory and copying across - // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // - if ( Platform.IsWindows ) - { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); - } - 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_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call ); - - return handle; + return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -33073,22 +26881,31 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct GSStatsUnloaded_t { - public const int CallbackId = CallbackIdentifiers.SteamUserStats + 8; - public ulong SteamIDUser; // m_steamIDUser class CSteamID + 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. // - public static GSStatsUnloaded_t FromPointer( IntPtr p ) + 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 { - public ulong SteamIDUser; // m_steamIDUser class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID // // Easily convert from PackSmall to GSStatsUnloaded_t @@ -33102,10 +26919,9 @@ public static implicit operator GSStatsUnloaded_t ( GSStatsUnloaded_t.PackSmall } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable @@ -33218,24 +27034,33 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo [StructLayout( LayoutKind.Sequential, Pack = 8 )] internal struct ItemInstalled_t { - public const int CallbackId = CallbackIdentifiers.ClientUGC + 5; - public uint AppID; // m_unAppID AppId_t - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_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. // - public static ItemInstalled_t FromPointer( IntPtr p ) + 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 { - public uint AppID; // m_unAppID AppId_t - public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal uint AppID; // m_unAppID AppId_t + internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t // // Easily convert from PackSmall to ItemInstalled_t @@ -33250,10 +27075,9 @@ public static implicit operator ItemInstalled_t ( ItemInstalled_t.PackSmall d ) } } - public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) { - var handle = new CallbackHandle(); - handle.steamworks = steamworks; + var handle = new CallbackHandle( steamworks ); // // Create the functions we need for the vtable diff --git a/Generator/CodeWriter/PlatformClass.cs b/Generator/CodeWriter/PlatformClass.cs index 2409263..68837b8 100644 --- a/Generator/CodeWriter/PlatformClass.cs +++ b/Generator/CodeWriter/PlatformClass.cs @@ -9,10 +9,12 @@ 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" ); { @@ -187,7 +189,10 @@ private void InteropClassMethod( string library, string classname, SteamApiDefin if ( argstring != "" ) argstring = $" {argstring} "; - Write( $"[DllImportAttribute( \"{library}\" )] " ); + if ( X86 ) + Write( $"[DllImport( \"{library}\", CallingConvention = CallingConvention.Cdecl )] " ); + else + Write( $"[DllImport( \"{library}\" )] " ); if ( ret.Return() == "bool" ) WriteLine( "[return: MarshalAs(UnmanagedType.U1)]" ); diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 21e5908..f1fc1ef 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -58,7 +58,7 @@ void Structs() { if ( !string.IsNullOrEmpty( c.CallbackId ) ) { - WriteLine( "public const int CallbackId = " + c.CallbackId + ";" ); + WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" ); } // @@ -70,7 +70,7 @@ void Structs() WriteLine( "//" ); WriteLine( "// Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff." ); WriteLine( "//" ); - StartBlock( $"public static {c.Name} FromPointer( IntPtr p )" ); + StartBlock( $"internal static {c.Name} FromPointer( IntPtr p )" ); { WriteLine( $"if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) );" ); @@ -78,6 +78,18 @@ void Structs() } 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) );" ); + + WriteLine( $"return System.Runtime.InteropServices.Marshal.SizeOf( typeof({c.Name}) );" ); + } + EndBlock(); + if ( defaultPack == 8 ) defaultPack = 4; @@ -199,17 +211,16 @@ private void StructFields( SteamApiDefinition.StructDef.StructFields[] fields ) WriteLine($"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U4)]"); } - WriteLine( $"public {t} {CleanMemberName( m.Name )}; // {m.Name} {m.Type}" ); + WriteLine( $"internal {t} {CleanMemberName( m.Name )}; // {m.Name} {m.Type}" ); } } private void Callback( SteamApiDefinition.StructDef c ) { WriteLine(); - StartBlock( $"public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action<{c.Name}, bool> CallbackFunction )" ); + StartBlock( $"internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action<{c.Name}, bool> CallbackFunction )" ); { - WriteLine( $"var handle = new CallbackHandle();" ); - WriteLine( $"handle.steamworks = steamworks;" ); + WriteLine( $"var handle = new CallbackHandle( steamworks );" ); WriteLine( $"" ); CallbackCallresultShared( c, false ); @@ -230,24 +241,21 @@ private void Callback( SteamApiDefinition.StructDef c ) private void CallResult( SteamApiDefinition.StructDef c ) { WriteLine(); - StartBlock( $"public static CallbackHandle CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action<{c.Name}, bool> CallbackFunction )" ); + StartBlock( $"internal static CallResult<{c.Name}> CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action<{c.Name}, bool> CallbackFunction )" ); { - WriteLine( $"var handle = new CallbackHandle();" ); - WriteLine( $"handle.steamworks = steamworks;" ); - WriteLine( $"handle.CallResultHandle = call;" ); - WriteLine( $"handle.CallResult = true;" ); - WriteLine( $"" ); + WriteLine( $"return new CallResult<{c.Name}>( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId );" ); + // WriteLine( $"" ); - CallbackCallresultShared( c, true ); + // CallbackCallresultShared( c, true ); - WriteLine( "" ); - WriteLine( "//" ); - WriteLine( "// Register the callback with Steam" ); - WriteLine( "//" ); - WriteLine( $"steamworks.native.api.SteamAPI_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call );" ); + // WriteLine( "" ); + // WriteLine( "//" ); + // WriteLine( "// Register the callback with Steam" ); + // WriteLine( "//" ); + // WriteLine( $"steamworks.native.api.SteamAPI_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call );" ); - WriteLine(); - WriteLine( "return handle;" ); + // WriteLine(); + //WriteLine( "return handle;" ); } EndBlock(); } From 68b409d1632689cdaed8e575cff9a1139994b536 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 14 Feb 2018 17:40:16 +0000 Subject: [PATCH 03/40] Callbacks uses static methods (IL2CPP Compatible) --- Facepunch.Steamworks/BaseSteamworks.cs | 34 + Facepunch.Steamworks/Client.cs | 8 +- Facepunch.Steamworks/Client/Achievements.cs | 10 +- Facepunch.Steamworks/Client/Friends.cs | 6 +- Facepunch.Steamworks/Client/Lobby.cs | 37 +- Facepunch.Steamworks/Client/LobbyList.cs | 4 +- .../Client/MicroTransactions.cs | 4 +- Facepunch.Steamworks/Config.cs | 15 +- .../Facepunch.Steamworks.csproj | 7 +- .../Interfaces/Inventory.Result.cs | 4 +- Facepunch.Steamworks/Interfaces/Inventory.cs | 14 +- Facepunch.Steamworks/Interfaces/Networking.cs | 8 +- Facepunch.Steamworks/Interfaces/Workshop.cs | 8 +- Facepunch.Steamworks/Server.cs | 5 +- Facepunch.Steamworks/Server/Auth.cs | 4 +- .../SteamNative/SteamNative.Callback.cs | 54 +- .../SteamNative/SteamNative.Structs.cs | 23658 +++++++++------- Generator/CodeWriter/Struct.cs | 164 +- 18 files changed, 13364 insertions(+), 10680 deletions(-) diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 49652ab..036432d 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -41,6 +41,8 @@ protected BaseSteamworks( uint appId ) public virtual void Dispose() { + Callbacks.Clear(); + foreach ( var h in CallbackHandles ) { h.Dispose(); @@ -157,5 +159,37 @@ public void UpdateWhile( Func func ) #endif } } + + 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 ); + } + } + + 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/Client.cs b/Facepunch.Steamworks/Client.cs index af65c20..d4c7ee0 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -89,6 +89,12 @@ public Client( uint appId ) : base( appId ) // SetupCommonInterfaces(); + // + // Register Callbacks + // + + SteamNative.Callbacks.RegisterCallbacks( this ); + // // Client only interfaces // @@ -121,8 +127,6 @@ public Client( uint appId ) : base( appId ) CurrentLanguage = native.apps.GetCurrentGameLanguage(); AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated - - // // Run update, first call does some initialization // diff --git a/Facepunch.Steamworks/Client/Achievements.cs b/Facepunch.Steamworks/Client/Achievements.cs index ba152cf..40abfc5 100644 --- a/Facepunch.Steamworks/Client/Achievements.cs +++ b/Facepunch.Steamworks/Client/Achievements.cs @@ -22,8 +22,8 @@ internal Achievements( Client c ) client = c; All = new Achievement[0]; - SteamNative.UserStatsReceived_t.RegisterCallback( c, UserStatsReceived ); - SteamNative.UserStatsStored_t.RegisterCallback( c, UserStatsStored ); + c.RegisterCallback( UserStatsReceived ); + c.RegisterCallback( UserStatsStored ); Refresh(); } @@ -100,9 +100,8 @@ public bool Reset( string identifier ) return client.native.userstats.ClearAchievement( identifier ); } - private void UserStatsReceived( UserStatsReceived_t stats, bool isError ) + private void UserStatsReceived( UserStatsReceived_t stats ) { - if ( isError ) return; if ( stats.GameID != client.AppId ) return; Refresh(); @@ -110,9 +109,8 @@ private void UserStatsReceived( UserStatsReceived_t stats, bool isError ) OnUpdated?.Invoke(); } - private void UserStatsStored( UserStatsStored_t stats, bool isError ) + private void UserStatsStored( UserStatsStored_t stats ) { - if ( isError ) return; if ( stats.GameID != client.AppId ) return; Refresh(); diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 36cd95d..0aea558 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -163,7 +163,7 @@ internal Friends( Client c ) { client = c; - SteamNative.PersonaStateChange_t.RegisterCallback( client, OnPersonaStateChange ); + client.RegisterCallback( OnPersonaStateChange ); } /// @@ -357,9 +357,9 @@ public SteamFriend Get( ulong steamid ) return f; } - private void OnPersonaStateChange( PersonaStateChange_t data, bool error ) + private void OnPersonaStateChange( PersonaStateChange_t data ) { - + // HUH } } diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index 510b4df..1d013a4 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -36,12 +36,13 @@ public enum Type : int public Lobby( Client c ) { client = c; - SteamNative.LobbyDataUpdate_t.RegisterCallback( client, OnLobbyDataUpdatedAPI ); - SteamNative.LobbyChatMsg_t.RegisterCallback( client, OnLobbyChatMessageRecievedAPI ); - SteamNative.LobbyChatUpdate_t.RegisterCallback( client, OnLobbyStateUpdatedAPI ); - SteamNative.GameLobbyJoinRequested_t.RegisterCallback( client, OnLobbyJoinRequestedAPI ); - SteamNative.LobbyInvite_t.RegisterCallback( client, OnUserInvitedToLobbyAPI ); - SteamNative.PersonaStateChange_t.RegisterCallback( client, OnLobbyMemberPersonaChangeAPI ); + + client.RegisterCallback( OnLobbyDataUpdatedAPI ); + client.RegisterCallback( OnLobbyChatMessageRecievedAPI ); + client.RegisterCallback( OnLobbyStateUpdatedAPI ); + client.RegisterCallback( OnLobbyJoinRequestedAPI ); + client.RegisterCallback( OnUserInvitedToLobbyAPI ); + client.RegisterCallback( OnLobbyMemberPersonaChangeAPI ); } /// @@ -242,9 +243,10 @@ public string GetMemberData( ulong steamID, string key ) return client.native.matchmaking.GetLobbyMemberData( CurrentLobby, steamID, key ); } - internal void OnLobbyDataUpdatedAPI( LobbyDataUpdate_t callback, bool error ) + internal void OnLobbyDataUpdatedAPI( LobbyDataUpdate_t callback ) { - if ( error || (callback.SteamIDLobby != CurrentLobby) ) { return; } + if ( callback.SteamIDLobby != CurrentLobby ) return; + if ( callback.SteamIDLobby == CurrentLobby ) //actual lobby data was updated by owner { UpdateLobbyData(); @@ -320,10 +322,10 @@ public Type LobbyType private static byte[] chatMessageData = new byte[1024 * 4]; - private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback, bool error ) + private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback ) { //from Client.Networking - if ( error || callback.SteamIDLobby != CurrentLobby ) + if ( callback.SteamIDLobby != CurrentLobby ) return; SteamNative.CSteamID steamid = 1; @@ -380,9 +382,9 @@ public enum MemberStateChange Banned = ChatMemberStateChange.Banned, } - internal void OnLobbyStateUpdatedAPI( LobbyChatUpdate_t callback, bool error ) + internal void OnLobbyStateUpdatedAPI( LobbyChatUpdate_t callback ) { - if ( error || callback.SteamIDLobby != CurrentLobby ) + if ( callback.SteamIDLobby != CurrentLobby ) return; MemberStateChange change = (MemberStateChange)callback.GfChatMemberStateChange; @@ -555,9 +557,9 @@ public bool InviteUserToLobby( ulong friendID ) return client.native.matchmaking.InviteUserToLobby( CurrentLobby, friendID ); } - internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback, bool error ) + internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback ) { - if ( error || (callback.GameID != client.AppId) ) { return; } + if ( callback.GameID != client.AppId ) return; if ( OnUserInvitedToLobby != null ) { OnUserInvitedToLobby( callback.SteamIDLobby, callback.SteamIDUser ); } } @@ -570,18 +572,17 @@ internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback, bool error ) /// /// 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, bool error ) + internal void OnLobbyJoinRequestedAPI( GameLobbyJoinRequested_t callback ) { - if ( error ) { return; } Join( callback.SteamIDLobby ); } /// /// Makes sure we send an update callback if a Lobby user updates their information /// - internal void OnLobbyMemberPersonaChangeAPI( PersonaStateChange_t callback, bool error ) + internal void OnLobbyMemberPersonaChangeAPI( PersonaStateChange_t callback ) { - if ( error || !UserIsInCurrentLobby( callback.SteamID ) ) { return; } + if ( !UserIsInCurrentLobby( callback.SteamID ) ) return; if ( OnLobbyMemberDataUpdated != null ) { OnLobbyMemberDataUpdated( callback.SteamID ); } } diff --git a/Facepunch.Steamworks/Client/LobbyList.cs b/Facepunch.Steamworks/Client/LobbyList.cs index 905695d..a8ed9a2 100644 --- a/Facepunch.Steamworks/Client/LobbyList.cs +++ b/Facepunch.Steamworks/Client/LobbyList.cs @@ -101,7 +101,7 @@ void OnLobbyList(LobbyMatchList_t callback, bool error) { //else we need to get the info for the missing lobby client.native.matchmaking.RequestLobbyData(lobby); - SteamNative.LobbyDataUpdate_t.RegisterCallback(client, OnLobbyDataUpdated); + client.RegisterCallback( OnLobbyDataUpdated ); } } @@ -121,7 +121,7 @@ void checkFinished() Finished = false; } - void OnLobbyDataUpdated(LobbyDataUpdate_t callback, bool error) + void OnLobbyDataUpdated(LobbyDataUpdate_t callback) { if (callback.Success == 1) //1 if success, 0 if failure { diff --git a/Facepunch.Steamworks/Client/MicroTransactions.cs b/Facepunch.Steamworks/Client/MicroTransactions.cs index 6c7af88..240b35b 100644 --- a/Facepunch.Steamworks/Client/MicroTransactions.cs +++ b/Facepunch.Steamworks/Client/MicroTransactions.cs @@ -23,10 +23,10 @@ internal MicroTransactions( Client c ) { client = c; - SteamNative.MicroTxnAuthorizationResponse_t.RegisterCallback( client, onMicroTxnAuthorizationResponse ); + client.RegisterCallback( onMicroTxnAuthorizationResponse ); } - private void onMicroTxnAuthorizationResponse( MicroTxnAuthorizationResponse_t arg1, bool arg2 ) + private void onMicroTxnAuthorizationResponse( MicroTxnAuthorizationResponse_t arg1 ) { if ( OnAuthorizationResponse != null ) { diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index 6ac0dee..3d79a4e 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -18,11 +18,6 @@ public static void ForUnity( string platform ) // if ( platform == "WindowsEditor" || platform == "WindowsPlayer" ) { - // - // 32bit windows unity uses a stdcall - // - if ( IntPtr.Size == 4 ) UseThisCall = false; - ForcePlatform( OperatingSystem.Windows, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); } @@ -36,6 +31,8 @@ public static void ForUnity( string platform ) ForcePlatform( OperatingSystem.Linux, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); } + IsUnity = true; + Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch ); @@ -50,7 +47,13 @@ public static void ForUnity( string platform ) /// for releasing his shit open source under the MIT license so we can all learn and iterate. /// /// - public static bool UseThisCall { get; set; } = true; + internal static bool UseThisCall { get { return SteamNative.Platform.Os == OperatingSystem.Windows && !IsUnity; } } + + + /// + /// Should be true if we're using Unity + /// + internal static bool IsUnity { get; set; } /// diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj index a910c47..2750edb 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.csproj @@ -26,7 +26,7 @@ - + @@ -36,5 +36,10 @@ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client + + + full + true + diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs index 1c80b94..b09befd 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs @@ -139,9 +139,9 @@ internal void Fill() } } - internal void OnSteamResult( SteamInventoryResultReady_t data, bool error ) + internal void OnSteamResult( SteamInventoryResultReady_t data ) { - var success = data.Result == SteamNative.Result.OK && !error; + var success = data.Result == SteamNative.Result.OK; if ( success ) { diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index 97b6837..1f1dbe3 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -54,8 +54,8 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo if ( !server ) { - SteamNative.SteamInventoryResultReady_t.RegisterCallback( steamworks, onResultReady ); - SteamNative.SteamInventoryFullUpdate_t.RegisterCallback( steamworks, onFullUpdate ); + steamworks.RegisterCallback( onResultReady ); + steamworks.RegisterCallback( onFullUpdate ); // // Get a list of our items immediately @@ -67,10 +67,8 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo /// /// We've received a FULL update /// - private void onFullUpdate( SteamInventoryFullUpdate_t data, bool error ) + private void onFullUpdate( SteamInventoryFullUpdate_t data ) { - if ( error ) return; - var result = new Result( this, data.Handle, false ); result.Fill(); @@ -80,15 +78,15 @@ private void onFullUpdate( SteamInventoryFullUpdate_t data, bool error ) /// /// A generic result has returned. /// - private void onResultReady( SteamInventoryResultReady_t data, bool error ) + private void onResultReady( SteamInventoryResultReady_t data ) { if ( Result.Pending.ContainsKey( data.Handle ) ) { var result = Result.Pending[data.Handle]; - result.OnSteamResult( data, error ); + result.OnSteamResult( data ); - if ( !error && data.Result == SteamNative.Result.OK ) + if ( data.Result == SteamNative.Result.OK ) { onResult( result, false ); } diff --git a/Facepunch.Steamworks/Interfaces/Networking.cs b/Facepunch.Steamworks/Interfaces/Networking.cs index 8d3b0c4..f48fefd 100644 --- a/Facepunch.Steamworks/Interfaces/Networking.cs +++ b/Facepunch.Steamworks/Interfaces/Networking.cs @@ -26,8 +26,8 @@ internal Networking( BaseSteamworks steamworks, SteamNative.SteamNetworking netw { this.networking = networking; - SteamNative.P2PSessionRequest_t.RegisterCallback( steamworks, onP2PConnectionRequest ); - SteamNative.P2PSessionConnectFail_t.RegisterCallback( steamworks, onP2PConnectionFailed ); + steamworks.RegisterCallback( onP2PConnectionRequest ); + steamworks.RegisterCallback( onP2PConnectionFailed ); } public void Dispose() @@ -80,7 +80,7 @@ public void SetListenChannel( int ChannelId, bool Listen ) } } - private void onP2PConnectionRequest( SteamNative.P2PSessionRequest_t o, bool b ) + private void onP2PConnectionRequest( SteamNative.P2PSessionRequest_t o ) { if ( OnIncomingConnection != null ) { @@ -116,7 +116,7 @@ public enum SessionError : byte Max = 5 }; - private void onP2PConnectionFailed( SteamNative.P2PSessionConnectFail_t o, bool b ) + private void onP2PConnectionFailed( SteamNative.P2PSessionConnectFail_t o ) { if ( OnConnectionFailed != null ) { diff --git a/Facepunch.Steamworks/Interfaces/Workshop.cs b/Facepunch.Steamworks/Interfaces/Workshop.cs index c32713a..64ae67e 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.cs @@ -46,8 +46,8 @@ internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNat this.steamworks = steamworks; this.remoteStorage = remoteStorage; - SteamNative.DownloadItemResult_t.RegisterCallback( steamworks, onDownloadResult ); - SteamNative.ItemInstalled_t.RegisterCallback( steamworks, onItemInstalled ); + steamworks.RegisterCallback( onDownloadResult ); + steamworks.RegisterCallback( onItemInstalled ); } /// @@ -64,13 +64,13 @@ public void Dispose() OnItemInstalled = null; } - private void onItemInstalled( SteamNative.ItemInstalled_t obj, bool failed ) + 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, bool failed ) + private void onDownloadResult( SteamNative.DownloadItemResult_t obj ) { if ( OnFileDownloaded != null && obj.AppID == Client.Instance.AppId ) OnFileDownloaded( obj.PublishedFileId, (Callbacks.Result) obj.Result ); diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs index 900a983..f4947ee 100644 --- a/Facepunch.Steamworks/Server.cs +++ b/Facepunch.Steamworks/Server.cs @@ -53,9 +53,10 @@ public Server( uint appId, ServerInit init) : base( appId ) SetupCommonInterfaces(); // - // Cache common, unchanging info + // Register Callbacks // - AppId = appId; + + SteamNative.Callbacks.RegisterCallbacks( this ); // // Initial settings diff --git a/Facepunch.Steamworks/Server/Auth.cs b/Facepunch.Steamworks/Server/Auth.cs index 24ded75..f94cddc 100644 --- a/Facepunch.Steamworks/Server/Auth.cs +++ b/Facepunch.Steamworks/Server/Auth.cs @@ -35,10 +35,10 @@ internal ServerAuth( Server s ) { server = s; - SteamNative.ValidateAuthTicketResponse_t.RegisterCallback( server, OnAuthTicketValidate ); + server.RegisterCallback( OnAuthTicketValidate ); } - void OnAuthTicketValidate( SteamNative.ValidateAuthTicketResponse_t data, bool b ) + void OnAuthTicketValidate( SteamNative.ValidateAuthTicketResponse_t data ) { if ( OnAuthChange != null ) OnAuthChange( data.SteamID, data.OwnerSteamID, (Status) data.AuthSessionResponse ); diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs index ede1d4f..fd0f384 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs @@ -20,29 +20,50 @@ internal enum Flags : byte [StructLayout( LayoutKind.Sequential, Pack = 1 )] public class VTable { - public IntPtr ResultA; - public IntPtr ResultB; - public IntPtr GetSize; + [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; } - // - // All possible functions - // - internal class ThisCall + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public class VTableWin { - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate void Result( IntPtr thisptr, IntPtr pvParam ); - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate void ResultWithInfo( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamNative.SteamAPICall_t hSteamAPICall ); - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate int GetSize( IntPtr thisptr ); + [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; } - internal class StdCall + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public class VTableThis { - [UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate void Result( IntPtr pvParam ); - [UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate void ResultWithInfo( IntPtr pvParam, bool bIOFailure, SteamNative.SteamAPICall_t hSteamAPICall ); - [UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate int GetSize(); + [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; + } }; // @@ -169,4 +190,9 @@ unsafe internal override void RunCallback() } } } + + internal class MonoPInvokeCallbackAttribute : Attribute + { + public MonoPInvokeCallbackAttribute( Type t ) { } + } } diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index be5603c..a118b90 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -100,7 +100,7 @@ public static implicit operator SteamServerConnectFailure_t ( SteamServerConnec } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -109,85 +109,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamServerConnectFailure_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamServerConnectFailure_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -210,6 +196,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -253,7 +268,7 @@ public static implicit operator SteamServersDisconnected_t ( SteamServersDiscon } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -262,85 +277,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamServersDisconnected_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamServersDisconnected_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -363,6 +364,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -418,7 +448,7 @@ public static implicit operator ClientGameServerDeny_t ( ClientGameServerDeny_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -427,85 +457,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ClientGameServerDeny_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ClientGameServerDeny_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -528,6 +544,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -577,7 +622,7 @@ public static implicit operator ValidateAuthTicketResponse_t ( ValidateAuthTick } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -586,85 +631,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ValidateAuthTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ValidateAuthTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -687,6 +718,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -736,7 +796,7 @@ public static implicit operator MicroTxnAuthorizationResponse_t ( MicroTxnAutho } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -745,85 +805,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MicroTxnAuthorizationResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MicroTxnAuthorizationResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -846,6 +892,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -894,7 +969,7 @@ internal static CallResult CallResult( Facepunch.S return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -903,85 +978,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( EncryptedAppTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( EncryptedAppTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1004,6 +1065,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1050,7 +1140,7 @@ public static implicit operator GetAuthSessionTicketResponse_t ( GetAuthSession } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1059,85 +1149,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetAuthSessionTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetAuthSessionTicketResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1160,6 +1236,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1205,7 +1310,7 @@ public static implicit operator GameWebCallback_t ( GameWebCallback_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1214,85 +1319,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameWebCallback_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameWebCallback_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1315,6 +1406,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1365,7 +1485,7 @@ internal static CallResult CallResult( Facepunch.Steamwo return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1374,85 +1494,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StoreAuthURLResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StoreAuthURLResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1475,6 +1581,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1618,7 +1753,7 @@ public static implicit operator PersonaStateChange_t ( PersonaStateChange_t.Pac } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1627,85 +1762,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( PersonaStateChange_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( PersonaStateChange_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1728,6 +1849,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1771,7 +1921,7 @@ public static implicit operator GameOverlayActivated_t ( GameOverlayActivated_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1780,85 +1930,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameOverlayActivated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameOverlayActivated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -1881,6 +2017,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -1931,7 +2096,7 @@ public static implicit operator GameServerChangeRequested_t ( GameServerChangeR } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -1940,85 +2105,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameServerChangeRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameServerChangeRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2041,6 +2192,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2087,7 +2267,7 @@ public static implicit operator GameLobbyJoinRequested_t ( GameLobbyJoinRequest } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2096,85 +2276,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameLobbyJoinRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameLobbyJoinRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2197,6 +2363,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2249,7 +2444,7 @@ public static implicit operator AvatarImageLoaded_t ( AvatarImageLoaded_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2258,85 +2453,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AvatarImageLoaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AvatarImageLoaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2359,6 +2540,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2413,7 +2623,7 @@ internal static CallResult CallResult( Facepunch.Stea return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2422,85 +2632,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ClanOfficerListResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ClanOfficerListResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2523,6 +2719,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2569,7 +2794,7 @@ public static implicit operator FriendRichPresenceUpdate_t ( FriendRichPresence } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2578,85 +2803,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendRichPresenceUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendRichPresenceUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2679,6 +2890,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2727,7 +2967,7 @@ public static implicit operator GameRichPresenceJoinRequested_t ( GameRichPrese } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2736,85 +2976,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameRichPresenceJoinRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameRichPresenceJoinRequested_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2837,6 +3063,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -2886,7 +3141,7 @@ public static implicit operator GameConnectedClanChatMsg_t ( GameConnectedClanC } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -2895,85 +3150,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameConnectedClanChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameConnectedClanChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -2996,6 +3237,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3042,7 +3312,7 @@ public static implicit operator GameConnectedChatJoin_t ( GameConnectedChatJoin } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3051,85 +3321,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameConnectedChatJoin_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameConnectedChatJoin_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3152,6 +3408,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3208,7 +3493,7 @@ public static implicit operator GameConnectedChatLeave_t ( GameConnectedChatLea } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3217,85 +3502,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameConnectedChatLeave_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameConnectedChatLeave_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3318,6 +3589,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3363,7 +3663,7 @@ public static implicit operator DownloadClanActivityCountsResult_t ( DownloadCl } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3372,85 +3672,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( DownloadClanActivityCountsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( DownloadClanActivityCountsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3473,6 +3759,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3524,7 +3839,7 @@ internal static CallResult CallResult( Facep return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3533,85 +3848,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( JoinClanChatRoomCompletionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( JoinClanChatRoomCompletionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3634,6 +3935,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3680,7 +4010,7 @@ public static implicit operator GameConnectedFriendChatMsg_t ( GameConnectedFri } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3689,85 +4019,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GameConnectedFriendChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GameConnectedFriendChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3790,6 +4106,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -3844,7 +4189,7 @@ internal static CallResult CallResult( Facepunch.Stea return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -3853,85 +4198,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsGetFollowerCount_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsGetFollowerCount_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -3954,6 +4285,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4010,7 +4370,7 @@ internal static CallResult CallResult( Facepunch.Steamwork return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4019,85 +4379,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsIsFollowing_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsIsFollowing_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4120,6 +4466,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4179,7 +4554,7 @@ internal static CallResult CallResult( Facepunc return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4188,85 +4563,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FriendsEnumerateFollowingList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FriendsEnumerateFollowingList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4289,6 +4650,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4347,7 +4737,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4356,85 +4746,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SetPersonaNameResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SetPersonaNameResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4457,6 +4833,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4500,7 +4905,7 @@ public static implicit operator LowBatteryPower_t ( LowBatteryPower_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4509,85 +4914,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LowBatteryPower_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LowBatteryPower_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4610,6 +5001,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4659,7 +5079,7 @@ public static implicit operator SteamAPICallCompleted_t ( SteamAPICallCompleted } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4668,85 +5088,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamAPICallCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamAPICallCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4769,6 +5175,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4817,7 +5252,7 @@ internal static CallResult CallResult( Facepunch.Steamwork return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4826,85 +5261,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( CheckFileSignature_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( CheckFileSignature_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -4927,6 +5348,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -4975,7 +5425,7 @@ public static implicit operator GamepadTextInputDismissed_t ( GamepadTextInputD } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -4984,85 +5434,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GamepadTextInputDismissed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GamepadTextInputDismissed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -5085,6 +5521,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -5353,7 +5818,7 @@ public static implicit operator FavoritesListChanged_t ( FavoritesListChanged_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -5362,85 +5827,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FavoritesListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FavoritesListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -5463,6 +5914,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -5512,7 +5992,7 @@ public static implicit operator LobbyInvite_t ( LobbyInvite_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -5521,85 +6001,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyInvite_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyInvite_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -5622,6 +6088,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -5681,7 +6176,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.BaseSt return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -5690,85 +6185,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyEnter_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyEnter_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -5791,6 +6272,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -5840,7 +6350,7 @@ public static implicit operator LobbyDataUpdate_t ( LobbyDataUpdate_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -5849,85 +6359,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyDataUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyDataUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -5950,6 +6446,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6002,7 +6527,7 @@ public static implicit operator LobbyChatUpdate_t ( LobbyChatUpdate_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6011,85 +6536,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyChatUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyChatUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6112,6 +6623,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6164,7 +6704,7 @@ public static implicit operator LobbyChatMsg_t ( LobbyChatMsg_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6173,85 +6713,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyChatMsg_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6274,6 +6800,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6326,7 +6881,7 @@ public static implicit operator LobbyGameCreated_t ( LobbyGameCreated_t.PackSma } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6335,85 +6890,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyGameCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyGameCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6436,6 +6977,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6484,7 +7054,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.Ba return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6493,85 +7063,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyMatchList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyMatchList_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6594,6 +7150,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6643,7 +7228,7 @@ public static implicit operator LobbyKicked_t ( LobbyKicked_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6652,85 +7237,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyKicked_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyKicked_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6753,6 +7324,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6804,7 +7404,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.Base return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6813,85 +7413,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LobbyCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LobbyCreated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -6914,6 +7500,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -6962,7 +7577,7 @@ public static implicit operator PSNGameBootInviteResult_t ( PSNGameBootInviteRe } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -6971,85 +7586,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( PSNGameBootInviteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( PSNGameBootInviteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7072,6 +7673,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7115,7 +7745,7 @@ public static implicit operator FavoritesListAccountsUpdated_t ( FavoritesListA } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7124,85 +7754,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FavoritesListAccountsUpdated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FavoritesListAccountsUpdated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7225,6 +7841,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7318,7 +7963,7 @@ public static implicit operator RemoteStorageAppSyncedClient_t ( RemoteStorageA } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7327,85 +7972,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncedClient_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncedClient_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7428,6 +8059,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7477,7 +8137,7 @@ public static implicit operator RemoteStorageAppSyncedServer_t ( RemoteStorageA } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7486,85 +8146,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncedServer_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncedServer_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7587,6 +8233,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7646,7 +8321,7 @@ public static implicit operator RemoteStorageAppSyncProgress_t ( RemoteStorageA } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7655,85 +8330,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7756,6 +8417,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7802,7 +8492,7 @@ public static implicit operator RemoteStorageAppSyncStatusCheck_t ( RemoteStora } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7811,85 +8501,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncStatusCheck_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageAppSyncStatusCheck_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -7912,6 +8588,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -7968,7 +8673,7 @@ internal static CallResult CallResult( Facepunch return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -7977,85 +8682,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileShareResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileShareResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8078,6 +8769,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8129,7 +8849,7 @@ public static implicit operator RemoteStoragePublishFileResult_t ( RemoteStorag } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8138,85 +8858,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8239,6 +8945,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8290,7 +9025,7 @@ internal static CallResult CallResult( return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8299,85 +9034,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageDeletePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageDeletePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8400,6 +9121,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8459,7 +9209,7 @@ internal static CallResult Cal return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8468,85 +9218,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserPublishedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserPublishedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8569,6 +9305,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8620,7 +9385,7 @@ internal static CallResult CallResu return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8629,85 +9394,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageSubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageSubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8730,6 +9481,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8794,7 +9574,7 @@ internal static CallResult Ca return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8803,85 +9583,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -8904,6 +9670,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -8955,7 +9750,7 @@ internal static CallResult CallRe return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -8964,85 +9759,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUnsubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUnsubscribePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9065,6 +9846,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -9121,7 +9931,7 @@ internal static CallResult CallResult( return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -9130,85 +9940,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUpdatePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUpdatePublishedFileResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9231,6 +10027,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -9296,7 +10121,7 @@ internal static CallResult CallResult( Facepun return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -9305,85 +10130,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageDownloadUGCResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageDownloadUGCResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9406,6 +10217,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -9530,7 +10370,7 @@ internal static CallResult CallRes return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -9539,85 +10379,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedFileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedFileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9640,6 +10466,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -9710,7 +10565,7 @@ internal static CallResult CallResu return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -9719,85 +10574,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9820,6 +10661,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -9883,7 +10753,7 @@ internal static CallResult Cal return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -9892,85 +10762,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedItemVoteDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageGetPublishedItemVoteDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -9993,6 +10849,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10039,7 +10924,7 @@ public static implicit operator RemoteStoragePublishedFileSubscribed_t ( Remote } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10048,85 +10933,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileSubscribed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileSubscribed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10149,6 +11020,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10195,7 +11095,7 @@ public static implicit operator RemoteStoragePublishedFileUnsubscribed_t ( Remo } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10204,85 +11104,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileUnsubscribed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileUnsubscribed_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10305,6 +11191,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10351,7 +11266,7 @@ public static implicit operator RemoteStoragePublishedFileDeleted_t ( RemoteSto } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10360,85 +11275,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileDeleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileDeleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10461,6 +11362,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10512,7 +11442,7 @@ internal static CallResult Cal return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10521,85 +11451,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUpdateUserPublishedItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUpdateUserPublishedItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10622,6 +11538,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10671,7 +11616,7 @@ public static implicit operator RemoteStorageUserVoteDetails_t ( RemoteStorageU } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10680,85 +11625,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageUserVoteDetails_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageUserVoteDetails_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10781,6 +11712,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10835,7 +11795,7 @@ public static implicit operator RemoteStorageEnumerateUserSharedWorkshopFilesRes } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -10844,85 +11804,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSharedWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumerateUserSharedWorkshopFilesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -10945,6 +11891,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -10999,7 +11974,7 @@ internal static CallResult Call return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11008,85 +11983,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageSetUserPublishedFileActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageSetUserPublishedFileActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11109,6 +12070,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -11176,7 +12166,7 @@ internal static CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11185,85 +12175,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11286,6 +12262,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -11339,7 +12344,7 @@ internal static CallResult CallResult( Facep return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11348,85 +12353,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishFileProgress_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11449,6 +12440,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -11498,7 +12518,7 @@ public static implicit operator RemoteStoragePublishedFileUpdated_t ( RemoteSto } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11507,85 +12527,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileUpdated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStoragePublishedFileUpdated_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11608,6 +12614,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -11656,7 +12691,7 @@ internal static CallResult CallResult( Fa return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11665,85 +12700,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileWriteAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileWriteAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11766,6 +12787,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -11823,7 +12873,7 @@ internal static CallResult CallResult( Fac return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -11832,85 +12882,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoteStorageFileReadAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoteStorageFileReadAsyncComplete_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -11933,6 +12969,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12040,7 +13105,7 @@ internal static CallResult CallResult( Facepunch.Steamworks return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12049,85 +13114,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12150,6 +13201,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12196,7 +13276,7 @@ public static implicit operator UserStatsStored_t ( UserStatsStored_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12205,85 +13285,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12306,6 +13372,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12365,7 +13460,7 @@ public static implicit operator UserAchievementStored_t ( UserAchievementStored } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12374,85 +13469,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserAchievementStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserAchievementStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12475,6 +13556,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12526,7 +13636,7 @@ internal static CallResult CallResult( Facepunch.Steamw return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12535,85 +13645,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardFindResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardFindResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12636,6 +13732,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12690,7 +13815,7 @@ internal static CallResult CallResult( Facepunch. return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12699,85 +13824,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardScoresDownloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardScoresDownloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12800,6 +13911,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -12863,7 +14003,7 @@ internal static CallResult CallResult( Facepunch.Ste return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -12872,85 +14012,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardScoreUploaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardScoreUploaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -12973,6 +14099,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13024,7 +14179,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13033,85 +14188,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( NumberOfCurrentPlayers_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( NumberOfCurrentPlayers_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13134,6 +14275,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13177,7 +14347,7 @@ public static implicit operator UserStatsUnloaded_t ( UserStatsUnloaded_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13186,85 +14356,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserStatsUnloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserStatsUnloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13287,6 +14443,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13343,7 +14528,7 @@ public static implicit operator UserAchievementIconFetched_t ( UserAchievementI } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13352,85 +14537,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserAchievementIconFetched_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserAchievementIconFetched_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13453,6 +14624,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13504,7 +14704,7 @@ internal static CallResult CallResult( Face return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13513,85 +14713,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GlobalAchievementPercentagesReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GlobalAchievementPercentagesReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13614,6 +14800,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13665,7 +14880,7 @@ internal static CallResult CallResult( Facepunch.Steamworks return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13674,85 +14889,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( LeaderboardUGCSet_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( LeaderboardUGCSet_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13775,6 +14976,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13824,7 +15054,7 @@ public static implicit operator PS3TrophiesInstalled_t ( PS3TrophiesInstalled_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13833,85 +15063,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( PS3TrophiesInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( PS3TrophiesInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -13934,6 +15150,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -13985,7 +15230,7 @@ internal static CallResult CallResult( Facepunch.Steamwor return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -13994,85 +15239,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GlobalStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GlobalStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14095,6 +15326,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14138,7 +15398,7 @@ public static implicit operator DlcInstalled_t ( DlcInstalled_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -14147,85 +15407,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( DlcInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( DlcInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14248,6 +15494,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14294,7 +15569,7 @@ public static implicit operator RegisterActivationCodeResponse_t ( RegisterActi } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -14303,85 +15578,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RegisterActivationCodeResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RegisterActivationCodeResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14404,6 +15665,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14458,7 +15748,7 @@ public static implicit operator AppProofOfPurchaseKeyResponse_t ( AppProofOfPur } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -14467,85 +15757,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AppProofOfPurchaseKeyResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AppProofOfPurchaseKeyResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14568,6 +15844,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14627,7 +15932,7 @@ internal static CallResult CallResult( Facepunch.Steamworks return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -14636,85 +15941,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( FileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( FileDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14737,6 +16028,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14842,7 +16162,7 @@ public static implicit operator P2PSessionRequest_t ( P2PSessionRequest_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -14851,85 +16171,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( P2PSessionRequest_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( P2PSessionRequest_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -14952,6 +16258,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -14998,7 +16333,7 @@ public static implicit operator P2PSessionConnectFail_t ( P2PSessionConnectFail } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15007,85 +16342,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( P2PSessionConnectFail_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( P2PSessionConnectFail_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15108,6 +16429,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15160,7 +16510,7 @@ public static implicit operator SocketStatusCallback_t ( SocketStatusCallback_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15169,85 +16519,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SocketStatusCallback_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SocketStatusCallback_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15270,6 +16606,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15316,7 +16681,7 @@ public static implicit operator ScreenshotReady_t ( ScreenshotReady_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15325,85 +16690,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ScreenshotReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ScreenshotReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15426,6 +16777,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15469,7 +16849,7 @@ public static implicit operator VolumeHasChanged_t ( VolumeHasChanged_t.PackSma } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15478,85 +16858,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( VolumeHasChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( VolumeHasChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15579,6 +16945,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15624,7 +17019,7 @@ public static implicit operator MusicPlayerWantsShuffled_t ( MusicPlayerWantsSh } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15633,85 +17028,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerWantsShuffled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerWantsShuffled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15734,6 +17115,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15779,7 +17189,7 @@ public static implicit operator MusicPlayerWantsLooped_t ( MusicPlayerWantsLoop } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15788,85 +17198,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerWantsLooped_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerWantsLooped_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -15889,6 +17285,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -15932,7 +17357,7 @@ public static implicit operator MusicPlayerWantsVolume_t ( MusicPlayerWantsVolu } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -15941,85 +17366,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerWantsVolume_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerWantsVolume_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16042,6 +17453,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16085,7 +17525,7 @@ public static implicit operator MusicPlayerSelectsQueueEntry_t ( MusicPlayerSel } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16094,85 +17534,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerSelectsQueueEntry_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerSelectsQueueEntry_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16195,6 +17621,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16238,7 +17693,7 @@ public static implicit operator MusicPlayerSelectsPlaylistEntry_t ( MusicPlayer } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16247,85 +17702,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerSelectsPlaylistEntry_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerSelectsPlaylistEntry_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16348,6 +17789,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16391,7 +17861,7 @@ public static implicit operator MusicPlayerWantsPlayingRepeatStatus_t ( MusicPl } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16400,85 +17870,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( MusicPlayerWantsPlayingRepeatStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( MusicPlayerWantsPlayingRepeatStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16501,6 +17957,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16558,7 +18043,7 @@ public static implicit operator HTTPRequestCompleted_t ( HTTPRequestCompleted_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16567,85 +18052,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTTPRequestCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTTPRequestCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16668,6 +18139,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16714,7 +18214,7 @@ public static implicit operator HTTPRequestHeadersReceived_t ( HTTPRequestHeade } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16723,85 +18223,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTTPRequestHeadersReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTTPRequestHeadersReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16824,6 +18310,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -16876,7 +18391,7 @@ public static implicit operator HTTPRequestDataReceived_t ( HTTPRequestDataRece } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -16885,85 +18400,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTTPRequestDataReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTTPRequestDataReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -16986,6 +18487,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -17348,7 +18878,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -17357,85 +18887,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamUGCQueryCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamUGCQueryCompleted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -17458,6 +18974,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -17506,7 +19051,7 @@ public static implicit operator SteamUGCRequestUGCDetailsResult_t ( SteamUGCReq } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -17515,85 +19060,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamUGCRequestUGCDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamUGCRequestUGCDetailsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -17616,6 +19147,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -17672,7 +19232,7 @@ internal static CallResult CallResult( Facepunch.Steamworks. return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -17681,85 +19241,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( CreateItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( CreateItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -17782,6 +19328,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -17838,7 +19413,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -17847,85 +19422,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SubmitItemUpdateResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SubmitItemUpdateResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -17948,6 +19509,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -17997,7 +19587,7 @@ public static implicit operator DownloadItemResult_t ( DownloadItemResult_t.Pac } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18006,85 +19596,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( DownloadItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( DownloadItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18107,6 +19683,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18163,7 +19768,7 @@ internal static CallResult CallResult( Facepunch return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18172,85 +19777,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( UserFavoriteItemsListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( UserFavoriteItemsListChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18273,6 +19864,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18329,7 +19949,7 @@ internal static CallResult CallResult( Facepunch.Steamw return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18338,85 +19958,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18439,6 +20045,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18505,7 +20140,7 @@ internal static CallResult CallResult( Facepunch.Steamw return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18514,85 +20149,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetUserItemVoteResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18615,6 +20236,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18663,7 +20313,7 @@ internal static CallResult CallResult( Facepunch. return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18672,85 +20322,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StartPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StartPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18773,6 +20409,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18821,7 +20486,7 @@ internal static CallResult CallResult( Facepunch.S return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18830,85 +20495,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( StopPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( StopPlaytimeTrackingResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -18931,6 +20582,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -18985,7 +20665,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -18994,85 +20674,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AddUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AddUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19095,6 +20761,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19149,7 +20844,7 @@ internal static CallResult CallResult( Facepunch.St return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19158,85 +20853,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoveUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoveUGCDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19259,6 +20940,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19313,7 +21023,7 @@ internal static CallResult CallResult( Facepunch.Steam return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19322,85 +21032,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AddAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AddAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19423,6 +21119,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19477,7 +21202,7 @@ internal static CallResult CallResult( Facepunch.St return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19486,85 +21211,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( RemoveAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( RemoveAppDependencyResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19587,6 +21298,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19649,7 +21389,7 @@ internal static CallResult CallResult( Facepunch.Ste return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19658,85 +21398,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetAppDependenciesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetAppDependenciesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19759,6 +21485,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19810,7 +21565,7 @@ internal static CallResult CallResult( Facepunch.Steamworks. return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19819,85 +21574,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( DeleteItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( DeleteItemResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -19920,6 +21661,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -19963,7 +21733,7 @@ public static implicit operator SteamAppInstalled_t ( SteamAppInstalled_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -19972,85 +21742,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamAppInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamAppInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -20073,6 +21829,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -20116,7 +21901,7 @@ public static implicit operator SteamAppUninstalled_t ( SteamAppUninstalled_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -20125,85 +21910,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamAppUninstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamAppUninstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -20226,6 +21997,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -20274,7 +22074,7 @@ internal static CallResult CallResult( Facepunch.Steamworks return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -20283,85 +22083,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_BrowserReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_BrowserReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -20384,6 +22170,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -20616,7 +22431,7 @@ public static implicit operator HTML_URLChanged_t ( HTML_URLChanged_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -20625,85 +22440,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_URLChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_URLChanged_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -20726,6 +22527,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -20775,7 +22605,7 @@ public static implicit operator HTML_FinishedRequest_t ( HTML_FinishedRequest_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -20784,85 +22614,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_FinishedRequest_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_FinishedRequest_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -20885,6 +22701,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -20931,7 +22776,7 @@ public static implicit operator HTML_OpenLinkInNewTab_t ( HTML_OpenLinkInNewTab } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -20940,85 +22785,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_OpenLinkInNewTab_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_OpenLinkInNewTab_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21041,6 +22872,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21087,7 +22947,7 @@ public static implicit operator HTML_ChangedTitle_t ( HTML_ChangedTitle_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21096,85 +22956,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_ChangedTitle_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_ChangedTitle_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21197,6 +23043,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21246,7 +23121,7 @@ public static implicit operator HTML_SearchResults_t ( HTML_SearchResults_t.Pac } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21255,85 +23130,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_SearchResults_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_SearchResults_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21356,6 +23217,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21409,7 +23299,7 @@ public static implicit operator HTML_CanGoBackAndForward_t ( HTML_CanGoBackAndF } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21418,85 +23308,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_CanGoBackAndForward_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_CanGoBackAndForward_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21519,6 +23395,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21579,7 +23484,7 @@ public static implicit operator HTML_HorizontalScroll_t ( HTML_HorizontalScroll } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21588,85 +23493,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_HorizontalScroll_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_HorizontalScroll_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21689,6 +23580,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21749,7 +23669,7 @@ public static implicit operator HTML_VerticalScroll_t ( HTML_VerticalScroll_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21758,85 +23678,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_VerticalScroll_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_VerticalScroll_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -21859,6 +23765,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -21921,7 +23856,7 @@ public static implicit operator HTML_LinkAtPosition_t ( HTML_LinkAtPosition_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -21930,85 +23865,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_LinkAtPosition_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_LinkAtPosition_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22031,6 +23952,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22077,7 +24027,7 @@ public static implicit operator HTML_JSAlert_t ( HTML_JSAlert_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22086,85 +24036,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_JSAlert_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_JSAlert_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22187,6 +24123,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22233,7 +24198,7 @@ public static implicit operator HTML_JSConfirm_t ( HTML_JSConfirm_t.PackSmall d } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22242,85 +24207,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_JSConfirm_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_JSConfirm_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22343,6 +24294,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22392,7 +24372,7 @@ public static implicit operator HTML_FileOpenDialog_t ( HTML_FileOpenDialog_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22401,85 +24381,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_FileOpenDialog_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_FileOpenDialog_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22502,6 +24468,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22563,7 +24558,7 @@ public static implicit operator HTML_NewWindow_t ( HTML_NewWindow_t.PackSmall d } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22572,85 +24567,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_NewWindow_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_NewWindow_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22673,6 +24654,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22719,7 +24729,7 @@ public static implicit operator HTML_SetCursor_t ( HTML_SetCursor_t.PackSmall d } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22728,85 +24738,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_SetCursor_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_SetCursor_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22829,6 +24825,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -22875,7 +24900,7 @@ public static implicit operator HTML_StatusText_t ( HTML_StatusText_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -22884,85 +24909,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_StatusText_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_StatusText_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -22985,6 +24996,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23031,7 +25071,7 @@ public static implicit operator HTML_ShowToolTip_t ( HTML_ShowToolTip_t.PackSma } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23040,85 +25080,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_ShowToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_ShowToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23141,6 +25167,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23187,7 +25242,7 @@ public static implicit operator HTML_UpdateToolTip_t ( HTML_UpdateToolTip_t.Pac } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23196,85 +25251,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_UpdateToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_UpdateToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23297,6 +25338,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23340,7 +25410,7 @@ public static implicit operator HTML_HideToolTip_t ( HTML_HideToolTip_t.PackSma } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23349,85 +25419,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_HideToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_HideToolTip_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23450,6 +25506,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23496,7 +25581,7 @@ public static implicit operator HTML_BrowserRestarted_t ( HTML_BrowserRestarted } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23505,85 +25590,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( HTML_BrowserRestarted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( HTML_BrowserRestarted_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23606,6 +25677,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23702,7 +25802,7 @@ public static implicit operator SteamInventoryResultReady_t ( SteamInventoryRes } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23711,85 +25811,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryResultReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryResultReady_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23812,6 +25898,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -23855,7 +25970,7 @@ public static implicit operator SteamInventoryFullUpdate_t ( SteamInventoryFull } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -23864,85 +25979,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryFullUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryFullUpdate_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -23965,6 +26066,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24024,7 +26154,7 @@ internal static CallResult CallResult( return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24033,85 +26163,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryEligiblePromoItemDefIDs_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryEligiblePromoItemDefIDs_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24134,6 +26250,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24188,7 +26333,7 @@ internal static CallResult CallResult( Face return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24197,85 +26342,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryStartPurchaseResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryStartPurchaseResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24298,6 +26429,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24351,7 +26511,7 @@ internal static CallResult CallResult( Face return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24360,85 +26520,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( SteamInventoryRequestPricesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( SteamInventoryRequestPricesResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24461,6 +26607,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24504,7 +26679,7 @@ public static implicit operator BroadcastUploadStop_t ( BroadcastUploadStop_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24513,85 +26688,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( BroadcastUploadStop_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( BroadcastUploadStop_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24614,6 +26775,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24665,7 +26855,7 @@ public static implicit operator GetVideoURLResult_t ( GetVideoURLResult_t.PackS } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24674,85 +26864,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetVideoURLResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetVideoURLResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24775,6 +26951,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24821,7 +27026,7 @@ public static implicit operator GetOPFSettingsResult_t ( GetOPFSettingsResult_t } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24830,85 +27035,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GetOPFSettingsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GetOPFSettingsResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -24931,6 +27122,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -24977,7 +27197,7 @@ public static implicit operator GSClientApprove_t ( GSClientApprove_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -24986,85 +27206,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSClientApprove_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSClientApprove_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25087,6 +27293,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25138,7 +27373,7 @@ public static implicit operator GSClientDeny_t ( GSClientDeny_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25147,85 +27382,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSClientDeny_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSClientDeny_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25248,6 +27469,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25294,7 +27544,7 @@ public static implicit operator GSClientKick_t ( GSClientKick_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25303,85 +27553,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSClientKick_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSClientKick_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25404,6 +27640,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25457,7 +27722,7 @@ public static implicit operator GSClientAchievementStatus_t ( GSClientAchieveme } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25466,85 +27731,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSClientAchievementStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSClientAchievementStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25567,6 +27818,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25610,7 +27890,7 @@ public static implicit operator GSPolicyResponse_t ( GSPolicyResponse_t.PackSma } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25619,85 +27899,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSPolicyResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSPolicyResponse_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25720,6 +27986,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25772,7 +28067,7 @@ public static implicit operator GSGameplayStats_t ( GSGameplayStats_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25781,85 +28076,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSGameplayStats_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSGameplayStats_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -25882,6 +28163,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -25938,7 +28248,7 @@ public static implicit operator GSClientGroupStatus_t ( GSClientGroupStatus_t.P } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -25947,85 +28257,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSClientGroupStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSClientGroupStatus_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26048,6 +28344,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26116,7 +28441,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.Base return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26125,85 +28450,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSReputation_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSReputation_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26226,6 +28537,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26274,7 +28614,7 @@ internal static CallResult CallResult( Facepunch.Stea return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26283,85 +28623,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( AssociateWithClanResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( AssociateWithClanResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26384,6 +28710,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26444,7 +28799,7 @@ internal static CallResult CallResult( Fa return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26453,85 +28808,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ComputeNewPlayerCompatibilityResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ComputeNewPlayerCompatibilityResult_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26554,6 +28895,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26605,7 +28975,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.B return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26614,85 +28984,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSStatsReceived_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26715,6 +29071,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26766,7 +29151,7 @@ internal static CallResult CallResult( Facepunch.Steamworks.Bas return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26775,85 +29160,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSStatsStored_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -26876,6 +29247,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -26919,7 +29319,7 @@ public static implicit operator GSStatsUnloaded_t ( GSStatsUnloaded_t.PackSmall } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -26928,85 +29328,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( GSStatsUnloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( GSStatsUnloaded_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -27029,6 +29415,35 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 )] @@ -27075,7 +29490,7 @@ public static implicit operator ItemInstalled_t ( ItemInstalled_t.PackSmall d ) } } - internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action CallbackFunction ) + internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) { var handle = new CallbackHandle( steamworks ); @@ -27084,85 +29499,71 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam // if ( Facepunch.Steamworks.Config.UseThisCall ) { - Callback.ThisCall.Result funcA = ( _, p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( ItemInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( _ ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } else { - Callback.StdCall.Result funcA = ( p ) => { CallbackFunction( FromPointer( p ), false ); }; - Callback.StdCall.ResultWithInfo funcB = ( p, bIOFailure, hSteamAPICall ) => { CallbackFunction( FromPointer( p ), bIOFailure ); }; - Callback.StdCall.GetSize funcC = ( ) => Marshal.SizeOf( typeof( ItemInstalled_t ) ); - - // - // If this platform is PackSmall, use PackSmall versions of everything instead - // - if ( Platform.PackSmall ) - { - funcC = ( ) => Marshal.SizeOf( typeof( PackSmall ) ); - } - - // - // Allocate a handle to each function, so they don't get disposed - // - handle.FuncA = GCHandle.Alloc( funcA ); - handle.FuncB = GCHandle.Alloc( funcB ); - handle.FuncC = GCHandle.Alloc( funcC ); - // // Create the VTable by manually allocating the memory and copying across // - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable() - { - ResultA = Marshal.GetFunctionPointerForDelegate( funcA ), - ResultB = Marshal.GetFunctionPointerForDelegate( funcB ), - GetSize = Marshal.GetFunctionPointerForDelegate( funcC ), - }; - // - // The order of these functions are swapped on Windows - // if ( Platform.IsWindows ) { - vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB ); - vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA ); + 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 ); } - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); } // @@ -27185,6 +29586,203 @@ internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steam steamworks.RegisterCallbackHandle( handle ); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static int OnGetSize(){ return StructSize(); } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + internal static void OnResult( IntPtr param ) + { + OnResultWithInfo( param, false, 0 ); + } + + [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + 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 ); + } + } } diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index f1fc1ef..74ad06d 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -37,6 +37,8 @@ public class TypeDef void Structs() { + var callbackList = new List(); + foreach ( var c in def.structs ) { if ( SkipStructs.Contains( c.Name ) ) @@ -133,12 +135,24 @@ void Structs() if ( !string.IsNullOrEmpty( c.CallbackId ) ) { Callback( c ); + callbackList.Add( c ); } } 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 ) @@ -216,14 +230,14 @@ private void StructFields( SteamApiDefinition.StructDef.StructFields[] fields ) } private void Callback( SteamApiDefinition.StructDef c ) - { + { WriteLine(); - StartBlock( $"internal static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamworks, Action<{c.Name}, bool> CallbackFunction )" ); + StartBlock( $"internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks )" ); { WriteLine( $"var handle = new CallbackHandle( steamworks );" ); WriteLine( $"" ); - CallbackCallresultShared( c, false ); + CallbackCall( c ); WriteLine( "" ); WriteLine( "//" ); @@ -235,6 +249,42 @@ private void Callback( SteamApiDefinition.StructDef c ) WriteLine( "steamworks.RegisterCallbackHandle( handle );" ); } EndBlock(); + + WriteLine(); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); }" ); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); }" ); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); }" ); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "internal static int OnGetSize(){ return StructSize(); }" ); + + WriteLine(); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + StartBlock( "internal static void OnResult( IntPtr param )" ); + { + WriteLine( $"OnResultWithInfo( param, false, 0 );" ); + } + EndBlock(); + + WriteLine(); + WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + 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(); } @@ -244,24 +294,12 @@ private void CallResult( SteamApiDefinition.StructDef c ) 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 );" ); - // WriteLine( $"" ); - - // CallbackCallresultShared( c, true ); - - // WriteLine( "" ); - // WriteLine( "//" ); - // WriteLine( "// Register the callback with Steam" ); - // WriteLine( "//" ); - // WriteLine( $"steamworks.native.api.SteamAPI_RegisterCallResult( handle.PinnedCallback.AddrOfPinnedObject(), call );" ); - - // WriteLine(); - //WriteLine( "return handle;" ); } EndBlock(); } - private void CallbackCallresultShared( SteamApiDefinition.StructDef c, bool Result ) + private void CallbackCall( SteamApiDefinition.StructDef c ) { WriteLine( "//" ); WriteLine( "// Create the functions we need for the vtable" ); @@ -269,11 +307,11 @@ private void CallbackCallresultShared( SteamApiDefinition.StructDef c, bool Resu StartBlock( "if ( Facepunch.Steamworks.Config.UseThisCall )" ); { - CallresultFunctions( c, Result, "ThisCall", "_" ); + CallFunctions( c, "ThisCall", "_" ); } Else(); { - CallresultFunctions( c, Result, "StdCall", "" ); + CallFunctions( c, "StdCall", "" ); } EndBlock(); @@ -293,73 +331,51 @@ private void CallbackCallresultShared( SteamApiDefinition.StructDef c, bool Resu WriteLine( $"handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned );" ); } - private void CallresultFunctions( SteamApiDefinition.StructDef c, bool Result, string ThisCall, string ThisArg ) + private void CallFunctions( SteamApiDefinition.StructDef c, string ThisCall, string ThisArg ) { var ThisArgC = ThisArg.Length > 0 ? $"{ThisArg}, " : ""; - - if ( Result ) - { - WriteLine( $"Callback.{ThisCall}.Result funcA = ( {ThisArgC}p ) => {{ handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }};" ); - StartBlock( $"Callback.{ThisCall}.ResultWithInfo funcB = ( {ThisArgC}p, bIOFailure, hSteamAPICall ) => " ); - { - WriteLine( "if ( hSteamAPICall != call ) return;" ); - WriteLine(); - WriteLine( "handle.CallResultHandle = 0;" ); - WriteLine( "handle.Dispose();" ); - WriteLine(); - WriteLine( "CallbackFunction( FromPointer( p ), bIOFailure );" ); - } - EndBlock( ";" ); - } - else - { - WriteLine( $"Callback.{ThisCall}.Result funcA = ( {ThisArgC}p ) => {{ CallbackFunction( FromPointer( p ), false ); }};" ); - WriteLine( $"Callback.{ThisCall}.ResultWithInfo funcB = ( {ThisArgC}p, bIOFailure, hSteamAPICall ) => {{ CallbackFunction( FromPointer( p ), bIOFailure ); }};" ); - } - - WriteLine( $"Callback.{ThisCall}.GetSize funcC = ( {ThisArg} ) => Marshal.SizeOf( typeof( {c.Name} ) );" ); - WriteLine(); - WriteLine( "//" ); - WriteLine( "// If this platform is PackSmall, use PackSmall versions of everything instead" ); - WriteLine( "//" ); - StartBlock( "if ( Platform.PackSmall )" ); - { - WriteLine( $"funcC = ( {ThisArg} ) => Marshal.SizeOf( typeof( PackSmall ) );" ); - } - EndBlock(); - - WriteLine( "" ); - WriteLine( "//" ); - WriteLine( "// Allocate a handle to each function, so they don't get disposed" ); - WriteLine( "//" ); - WriteLine( "handle.FuncA = GCHandle.Alloc( funcA );" ); - WriteLine( "handle.FuncB = GCHandle.Alloc( funcB );" ); - WriteLine( "handle.FuncC = GCHandle.Alloc( funcC );" ); - WriteLine(); + var This = ThisArg.Length > 0 ? "This" : ""; WriteLine( "//" ); WriteLine( "// Create the VTable by manually allocating the memory and copying across" ); WriteLine( "//" ); - WriteLine( "handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) );" ); - StartBlock( "var vTable = new Callback.VTable()" ); - { - WriteLine( "ResultA = Marshal.GetFunctionPointerForDelegate( funcA )," ); - WriteLine( "ResultB = Marshal.GetFunctionPointerForDelegate( funcB )," ); - WriteLine( "GetSize = Marshal.GetFunctionPointerForDelegate( funcC )," ); - } - EndBlock( ";" ); - - WriteLine( "//" ); - WriteLine( "// The order of these functions are swapped on Windows" ); - WriteLine( "//" ); StartBlock( "if ( Platform.IsWindows )" ); { - WriteLine( "vTable.ResultA = Marshal.GetFunctionPointerForDelegate( funcB );" ); - WriteLine( "vTable.ResultB = Marshal.GetFunctionPointerForDelegate( funcA );" ); + 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(); - WriteLine( "Marshal.StructureToPtr( vTable, handle.vTablePtr, false );" ); + } } } From ef8234b9584fc3ec7cff303012e653813fc97d6c Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 11:15:26 +0000 Subject: [PATCH 04/40] MonoPInvokeCallback doesn't really seem to need a Type --- .../SteamNative/SteamNative.Callback.cs | 2 +- .../SteamNative/SteamNative.Structs.cs | 1944 ++++++++--------- Generator/CodeWriter/Struct.cs | 12 +- 3 files changed, 979 insertions(+), 979 deletions(-) diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs index fd0f384..238b63f 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs @@ -193,6 +193,6 @@ unsafe internal override void RunCallback() internal class MonoPInvokeCallbackAttribute : Attribute { - public MonoPInvokeCallbackAttribute( Type t ) { } + public MonoPInvokeCallbackAttribute() { } } } diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index a118b90..59171f3 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -197,22 +197,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -365,22 +365,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -545,22 +545,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -719,22 +719,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -893,22 +893,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -1066,22 +1066,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -1237,22 +1237,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -1407,22 +1407,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -1582,22 +1582,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -1850,22 +1850,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2018,22 +2018,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2193,22 +2193,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2364,22 +2364,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2541,22 +2541,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2720,22 +2720,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -2891,22 +2891,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3064,22 +3064,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3238,22 +3238,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3409,22 +3409,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3590,22 +3590,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3760,22 +3760,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -3936,22 +3936,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -4107,22 +4107,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -4286,22 +4286,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -4467,22 +4467,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -4651,22 +4651,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -4834,22 +4834,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -5002,22 +5002,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -5176,22 +5176,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -5349,22 +5349,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -5522,22 +5522,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -5915,22 +5915,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6089,22 +6089,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6273,22 +6273,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6447,22 +6447,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6624,22 +6624,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6801,22 +6801,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -6978,22 +6978,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -7151,22 +7151,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -7325,22 +7325,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -7501,22 +7501,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -7674,22 +7674,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -7842,22 +7842,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8060,22 +8060,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8234,22 +8234,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8418,22 +8418,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8589,22 +8589,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8770,22 +8770,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -8946,22 +8946,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -9122,22 +9122,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -9306,22 +9306,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -9482,22 +9482,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -9671,22 +9671,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -9847,22 +9847,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -10028,22 +10028,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -10218,22 +10218,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -10467,22 +10467,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -10662,22 +10662,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -10850,22 +10850,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11021,22 +11021,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11192,22 +11192,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11363,22 +11363,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11539,22 +11539,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11713,22 +11713,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -11892,22 +11892,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12071,22 +12071,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12263,22 +12263,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12441,22 +12441,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12615,22 +12615,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12788,22 +12788,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -12970,22 +12970,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -13202,22 +13202,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -13373,22 +13373,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -13557,22 +13557,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -13733,22 +13733,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -13912,22 +13912,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14100,22 +14100,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14276,22 +14276,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14444,22 +14444,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14625,22 +14625,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14801,22 +14801,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -14977,22 +14977,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -15151,22 +15151,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -15327,22 +15327,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -15495,22 +15495,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -15666,22 +15666,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -15845,22 +15845,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16029,22 +16029,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16259,22 +16259,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16430,22 +16430,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16607,22 +16607,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16778,22 +16778,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -16946,22 +16946,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17116,22 +17116,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17286,22 +17286,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17454,22 +17454,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17622,22 +17622,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17790,22 +17790,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -17958,22 +17958,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -18140,22 +18140,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -18311,22 +18311,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -18488,22 +18488,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -18975,22 +18975,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -19148,22 +19148,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -19329,22 +19329,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -19510,22 +19510,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -19684,22 +19684,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -19865,22 +19865,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20046,22 +20046,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20237,22 +20237,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20410,22 +20410,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20583,22 +20583,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20762,22 +20762,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -20941,22 +20941,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21120,22 +21120,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21299,22 +21299,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21486,22 +21486,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21662,22 +21662,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21830,22 +21830,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -21998,22 +21998,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -22171,22 +22171,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -22528,22 +22528,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -22702,22 +22702,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -22873,22 +22873,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23044,22 +23044,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23218,22 +23218,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23396,22 +23396,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23581,22 +23581,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23766,22 +23766,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -23953,22 +23953,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24124,22 +24124,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24295,22 +24295,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24469,22 +24469,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24655,22 +24655,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24826,22 +24826,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -24997,22 +24997,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -25168,22 +25168,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -25339,22 +25339,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -25507,22 +25507,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -25678,22 +25678,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -25899,22 +25899,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26067,22 +26067,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26251,22 +26251,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26430,22 +26430,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26608,22 +26608,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26776,22 +26776,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -26952,22 +26952,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27123,22 +27123,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27294,22 +27294,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27470,22 +27470,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27641,22 +27641,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27819,22 +27819,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -27987,22 +27987,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -28164,22 +28164,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -28345,22 +28345,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -28538,22 +28538,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -28711,22 +28711,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -28896,22 +28896,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -29072,22 +29072,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -29248,22 +29248,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -29416,22 +29416,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; @@ -29587,22 +29587,22 @@ internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) steamworks.RegisterCallbackHandle( handle ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static int OnGetSize(){ return StructSize(); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResult( IntPtr param ) { OnResultWithInfo( param, false, 0 ); } - [MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )] + [MonoPInvokeCallback] internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) { if ( failure ) return; diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 74ad06d..866d9ab 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -251,17 +251,17 @@ private void Callback( SteamApiDefinition.StructDef c ) EndBlock(); WriteLine(); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); WriteLine( "internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); }" ); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); WriteLine( "internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); }" ); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); WriteLine( "internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); }" ); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); WriteLine( "internal static int OnGetSize(){ return StructSize(); }" ); WriteLine(); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); StartBlock( "internal static void OnResult( IntPtr param )" ); { WriteLine( $"OnResultWithInfo( param, false, 0 );" ); @@ -269,7 +269,7 @@ private void Callback( SteamApiDefinition.StructDef c ) EndBlock(); WriteLine(); - WriteLine( "[MonoPInvokeCallback( typeof( SteamNative.Callback.VTableThis.ResultD ) )]" ); + WriteLine( "[MonoPInvokeCallback]" ); StartBlock( "internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call )" ); { WriteLine( $"if ( failure ) return;" ); From 8d410969c301b219c88e38e6b5ab7e7357b2cec5 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 11:53:49 +0000 Subject: [PATCH 05/40] App.GetName + GetInstallFolder, GetBuildId --- Facepunch.Steamworks.Test/Client/AppTest.cs | 10 +++++++ Facepunch.Steamworks/Client.cs | 2 ++ Facepunch.Steamworks/Client/App.cs | 29 +++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/Facepunch.Steamworks.Test/Client/AppTest.cs b/Facepunch.Steamworks.Test/Client/AppTest.cs index f24f6a4..fb3e71f 100644 --- a/Facepunch.Steamworks.Test/Client/AppTest.cs +++ b/Facepunch.Steamworks.Test/Client/AppTest.cs @@ -51,5 +51,15 @@ public void PurchaseTime() } } + [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/Client.cs b/Facepunch.Steamworks/Client.cs index d4c7ee0..6ffee97 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -121,8 +121,10 @@ public Client( uint appId ) : base( appId ) 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 diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs index 8fc959a..8cd6b82 100644 --- a/Facepunch.Steamworks/Client/App.cs +++ b/Facepunch.Steamworks/Client/App.cs @@ -72,5 +72,34 @@ public bool IsInstalled(uint appId) { return client.native.apps.BIsAppInstalled(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 ); + } } } From 70c1513c192f751940ebe720d4ba6588cc285850 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 12:32:01 +0000 Subject: [PATCH 06/40] Fixed avatar downloading --- .../Client/FriendsTest.cs | 20 ++++-- Facepunch.Steamworks/Client.cs | 1 + Facepunch.Steamworks/Client/Friends.cs | 64 ++++++++++++++++--- 3 files changed, 69 insertions(+), 16 deletions(-) diff --git a/Facepunch.Steamworks.Test/Client/FriendsTest.cs b/Facepunch.Steamworks.Test/Client/FriendsTest.cs index d8fc65a..bcaf8a4 100644 --- a/Facepunch.Steamworks.Test/Client/FriendsTest.cs +++ b/Facepunch.Steamworks.Test/Client/FriendsTest.cs @@ -50,16 +50,23 @@ public void Avatar() { Assert.IsTrue( client.IsValid ); - var friend = client.Friends.All.First(); + ulong id = (ulong)( 76561197960279927 + (new Random().Next() % 10000)); bool passed = false; - client.Friends.GetAvatar( Steamworks.Friends.AvatarSize.Medium, friend.Id, (avatar) => + client.Friends.GetAvatar( Steamworks.Friends.AvatarSize.Medium, id, ( avatar) => { - Assert.AreEqual(avatar.Width, 64); - Assert.AreEqual(avatar.Height, 64); - Assert.AreEqual(avatar.Data.Length, avatar.Width * avatar.Height * 4); + 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); + DrawImage( avatar ); + } passed = true; }); @@ -105,6 +112,7 @@ public static void DrawImage( Image img ) 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]; } diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index 6ffee97..badfc21 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -145,6 +145,7 @@ public override void Update() RunCallbacks(); Voice.Update(); + Friends.Cycle(); base.Update(); } diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 0aea558..3dbe954 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -292,21 +292,24 @@ public Image GetCachedAvatar( AvatarSize size, ulong steamid ) break; } + if ( imageid == 0 || imageid == 2 ) + return null; + var img = new Image() { Id = imageid }; - if (imageid != 0 && img.TryLoad(client.native.utils)) - return img; + if ( !img.TryLoad( client.native.utils ) ) + return null; - return null; + return img; } /// /// Callback will be called when the avatar is ready. If we fail to get an - /// avatar, it'll be called with a null Image. + /// avatar, might be called with a null Image. /// public void GetAvatar( AvatarSize size, ulong steamid, Action callback ) { @@ -329,17 +332,18 @@ public void GetAvatar( AvatarSize size, ulong steamid, Action callback ) PersonaCallbacks.Add( new PersonaCallback { SteamId = steamid, - Callback = () => - { - callback( GetCachedAvatar(size, steamid) ); - } + Size = size, + Callback = callback, + Time = DateTime.Now }); } private class PersonaCallback { public ulong SteamId; - public Action Callback; + public AvatarSize Size; + public Action Callback; + public DateTime Time; } List PersonaCallbacks = new List(); @@ -357,9 +361,49 @@ public SteamFriend Get( ulong steamid ) return f; } + internal void Cycle() + { + if ( PersonaCallbacks.Count == 0 ) return; + + var timeOut = DateTime.Now.AddSeconds( -10 ); + + for ( int i = 0; i < PersonaCallbacks.Count; 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 ) { - // HUH + if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar + + for ( int i=0; i< PersonaCallbacks.Count; i++ ) + { + var cb = PersonaCallbacks[i]; + if ( cb.SteamId != data.SteamID ) continue; + + var image = GetCachedAvatar( cb.Size, cb.SteamId ); + if ( image == null ) continue; + + PersonaCallbacks.Remove( cb ); + + if ( cb.Callback != null ) + { + cb.Callback( image ); + } + } } } From 2587643b25377e41be1724d3676e17d456918c0c Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 12:33:24 +0000 Subject: [PATCH 07/40] Moved SteamFriend to own file --- Facepunch.Steamworks/Client/Friends.cs | 124 -------------------- Facepunch.Steamworks/Client/SteamFriend.cs | 128 +++++++++++++++++++++ 2 files changed, 128 insertions(+), 124 deletions(-) create mode 100644 Facepunch.Steamworks/Client/SteamFriend.cs diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 3dbe954..fcfb094 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -22,130 +22,6 @@ public Friends Friends } } - 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); - } - } - /// /// Handles most interactions with people in Steam, not just friends as the name would suggest. /// diff --git a/Facepunch.Steamworks/Client/SteamFriend.cs b/Facepunch.Steamworks/Client/SteamFriend.cs new file mode 100644 index 0000000..59457ec --- /dev/null +++ b/Facepunch.Steamworks/Client/SteamFriend.cs @@ -0,0 +1,128 @@ +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); + } + } +} From dd31847990d80de8ea53a53a48c6153bb0ab0085 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 12:43:52 +0000 Subject: [PATCH 08/40] Added Friends.OnInvitedToGame callback --- Facepunch.Steamworks/Client/Friends.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index fcfb094..3c557b7 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -40,6 +40,23 @@ internal Friends( Client c ) client = c; client.RegisterCallback( OnPersonaStateChange ); + client.RegisterCallback( OnGameJoinRequested ); + } + + 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 ); + } } /// @@ -226,6 +243,9 @@ private class PersonaCallback 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, From 1f121f508a44665942e38ae807c7e589ec739e4c Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:14:23 +0000 Subject: [PATCH 09/40] Added Item.Consume --- .../Interfaces/Inventory.Item.cs | 27 +++++++++++++++++++ Facepunch.Steamworks/Interfaces/Inventory.cs | 6 +---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs b/Facepunch.Steamworks/Interfaces/Inventory.Item.cs index f85754e..2240ee3 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Item.cs @@ -64,6 +64,33 @@ public override int GetHashCode() 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 ( !Definition.inventory.inventory.ConsumeItem( ref resultHandle, Id, (uint)amount ) ) + return null; + + return new Result( Definition.inventory, resultHandle, true ); + } + + /// + /// Split stack into two items + /// + public Result SplitStack( int quantity = 1 ) + { + SteamNative.SteamInventoryResult_t resultHandle = -1; + if ( !Definition.inventory.inventory.TransferItemQuantity( ref resultHandle, Id, (uint)quantity, ulong.MaxValue ) ) + return null; + + return new Result( Definition.inventory, resultHandle, true ); + } + SteamNative.SteamInventoryUpdateHandle_t updateHandle; private void UpdatingProperties() diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index 1f1dbe3..2245fcf 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -360,11 +360,7 @@ public Result CraftItem( Item.Amount[] list, Definition target ) /// public Result SplitStack( Item item, int quantity = 1 ) { - SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !inventory.TransferItemQuantity( ref resultHandle, item.Id, (uint)quantity, ulong.MaxValue ) ) - return null; - - return new Result( this, resultHandle, true ); + return item.SplitStack( quantity ); } /// From c4343ee3184a99fdafd425d39b339419518da305 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:15:39 +0000 Subject: [PATCH 10/40] Added App.IsDlcInstalled --- Facepunch.Steamworks/Client/App.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs index 8cd6b82..f448bf3 100644 --- a/Facepunch.Steamworks/Client/App.cs +++ b/Facepunch.Steamworks/Client/App.cs @@ -73,6 +73,14 @@ 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 From 28df21a19bdcdbd76437acefc4ac1ebc934ceca5 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:19:14 +0000 Subject: [PATCH 11/40] Added app.OnDlcInstalled callback --- Facepunch.Steamworks/Client/App.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs index f448bf3..404887b 100644 --- a/Facepunch.Steamworks/Client/App.cs +++ b/Facepunch.Steamworks/Client/App.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using SteamNative; namespace Facepunch.Steamworks { @@ -12,6 +13,23 @@ public class App : IDisposable 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() From 7abd06a806f85a924cc286796dfa69065240a902 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:23:36 +0000 Subject: [PATCH 12/40] Added Friends.ListenForFriendsMessages --- Facepunch.Steamworks/Client/Friends.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 3c557b7..7a69c1d 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -43,6 +43,28 @@ internal Friends( Client c ) client.RegisterCallback( OnGameJoinRequested ); } + 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 ); // From e71cce081794464bf6a20411310397f69b23be8e Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:34:04 +0000 Subject: [PATCH 13/40] Added Friends.OnChatMessage --- Facepunch.Steamworks/Client/Friends.cs | 34 ++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 7a69c1d..060fc8c 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -34,13 +34,43 @@ public Friends Friends public class Friends { internal Client client; + private byte[] buffer = new byte[1024 * 128]; internal Friends( Client c ) { client = c; - client.RegisterCallback( OnPersonaStateChange ); - client.RegisterCallback( OnGameJoinRequested ); + 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; From 727741b81ab6a52275e459f201cebb5bf4cbafd3 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:36:01 +0000 Subject: [PATCH 14/40] Added SteamFriend.SendMessage --- Facepunch.Steamworks/Client/SteamFriend.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Facepunch.Steamworks/Client/SteamFriend.cs b/Facepunch.Steamworks/Client/SteamFriend.cs index 59457ec..91206dd 100644 --- a/Facepunch.Steamworks/Client/SteamFriend.cs +++ b/Facepunch.Steamworks/Client/SteamFriend.cs @@ -124,5 +124,13 @@ 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 ); + } } } From 3895fd33aa8e462ca4550555c77b65a9904f81a8 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:43:07 +0000 Subject: [PATCH 15/40] Added servers stats ClearAchievement, GetAchievement --- Facepunch.Steamworks/Server/Stats.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Facepunch.Steamworks/Server/Stats.cs b/Facepunch.Steamworks/Server/Stats.cs index 0a28aa4..2238205 100644 --- a/Facepunch.Steamworks/Server/Stats.cs +++ b/Facepunch.Steamworks/Server/Stats.cs @@ -111,5 +111,26 @@ public float GetFloat( ulong steamid, string name, float defaultValue = 0 ) return data; } + + /// + /// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. + /// + 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; + } } } From 42d47a14c74b83b21b901b1254e391bfc21065f4 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:46:01 +0000 Subject: [PATCH 16/40] Added Networking.CloseSession --- Facepunch.Steamworks/Interfaces/Networking.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Facepunch.Steamworks/Interfaces/Networking.cs b/Facepunch.Steamworks/Interfaces/Networking.cs index f48fefd..ee8bca2 100644 --- a/Facepunch.Steamworks/Interfaces/Networking.cs +++ b/Facepunch.Steamworks/Interfaces/Networking.cs @@ -186,5 +186,14 @@ private unsafe bool ReadP2PPacket( int 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 ); + } } } From 71048f104115c91bd8a5da38d6774af7d8df8d02 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:47:21 +0000 Subject: [PATCH 17/40] Moved LobbyData to its own file --- .../Client/Lobby.LobbyData.cs | 112 ++++++++++++++++++ Facepunch.Steamworks/Client/Lobby.cs | 97 +-------------- 2 files changed, 113 insertions(+), 96 deletions(-) create mode 100644 Facepunch.Steamworks/Client/Lobby.LobbyData.cs diff --git a/Facepunch.Steamworks/Client/Lobby.LobbyData.cs b/Facepunch.Steamworks/Client/Lobby.LobbyData.cs new file mode 100644 index 0000000..63e4e84 --- /dev/null +++ b/Facepunch.Steamworks/Client/Lobby.LobbyData.cs @@ -0,0 +1,112 @@ +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 index 1d013a4..11a83bb 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -19,7 +19,7 @@ public Lobby Lobby } } } - public class Lobby : IDisposable + public partial class Lobby : IDisposable { //The type of lobby you are creating public enum Type : int @@ -127,101 +127,6 @@ internal void OnLobbyCreatedAPI( LobbyCreated_t callback, bool error ) /// public Action OnLobbyCreated; - /// - /// 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; - } - - } - /// /// Sets user data for the Lobby. Things like Character, Skin, Ready, etc. Can only set your own member data /// From 2ee5fa4a5df15bbd314ef431693b805a527b4d4b Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:59:36 +0000 Subject: [PATCH 18/40] Lobby GameServer information --- Facepunch.Steamworks/Client/Lobby.cs | 81 +++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index 11a83bb..bcf8afe 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -26,7 +26,7 @@ public enum Type : int { Private = SteamNative.LobbyType.Private, FriendsOnly = SteamNative.LobbyType.FriendsOnly, - Public = SteamNative.LobbyType.Public, + Public = SteamNative.LobbyType.Public, Invisible = SteamNative.LobbyType.Invisible, Error //happens if you try to get this when you aren't in a valid lobby } @@ -323,6 +323,17 @@ public string Name } } + /// + /// 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. /// @@ -491,6 +502,74 @@ internal void OnLobbyMemberPersonaChangeAPI( PersonaStateChange_t callback ) 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 From c4617c58841c02f97bd6c8631e6555367510001f Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 14:03:28 +0000 Subject: [PATCH 19/40] Fixed NRE in inventory result dispose --- Facepunch.Steamworks/Interfaces/Inventory.Result.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs index b09befd..3f1bfa2 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs @@ -14,7 +14,7 @@ public class Result : IDisposable internal static Dictionary< int, Result > Pending; internal Inventory inventory; - private SteamNative.SteamInventoryResult_t Handle { get; set; } + private SteamNative.SteamInventoryResult_t Handle { get; set; } = -1; /// /// Called when result is successfully returned @@ -169,8 +169,12 @@ internal unsafe byte[] Serialize() public void Dispose() { - inventory.inventory.DestroyResult( Handle ); - Handle = -1; + if ( Handle != -1 && inventory != null ) + { + inventory.inventory.DestroyResult( Handle ); + Handle = -1; + } + inventory = null; } } From 24c0edcbcb9163a1bc39cf72e2c33483ba01f675 Mon Sep 17 00:00:00 2001 From: speedis Date: Fri, 16 Feb 2018 22:50:19 +0100 Subject: [PATCH 20/40] Added servers stats SetAchievement --- Facepunch.Steamworks/Server/Stats.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Facepunch.Steamworks/Server/Stats.cs b/Facepunch.Steamworks/Server/Stats.cs index 2238205..e30a22d 100644 --- a/Facepunch.Steamworks/Server/Stats.cs +++ b/Facepunch.Steamworks/Server/Stats.cs @@ -112,8 +112,18 @@ public float GetFloat( ulong steamid, string name, float defaultValue = 0 ) 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 ) { From 6982d0504255a8f9dc72b6e9199627e9ebb17dbe Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 19 Feb 2018 10:59:57 +0000 Subject: [PATCH 21/40] Unity fixes --- Facepunch.Steamworks/Client/Friends.cs | 3 ++- Facepunch.Steamworks/Client/Image.cs | 4 ++-- Facepunch.Steamworks/Config.cs | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 060fc8c..00bea27 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -237,7 +237,7 @@ public Image GetCachedAvatar( AvatarSize size, ulong steamid ) break; } - if ( imageid == 0 || imageid == 2 ) + if ( imageid >= 0 && imageid <= 10 ) return null; var img = new Image() @@ -333,6 +333,7 @@ internal void Cycle() } } + private void OnPersonaStateChange( PersonaStateChange_t data ) { if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar diff --git a/Facepunch.Steamworks/Client/Image.cs b/Facepunch.Steamworks/Client/Image.cs index 0dc56ea..03d3ed5 100644 --- a/Facepunch.Steamworks/Client/Image.cs +++ b/Facepunch.Steamworks/Client/Image.cs @@ -29,7 +29,7 @@ unsafe internal bool TryLoad( SteamNative.SteamUtils utils ) if ( utils.GetImageSize( Id, out width, out height ) == false ) { IsError = true; - return true; + return false; } var buffer = new byte[ width * height * 4 ]; @@ -39,7 +39,7 @@ unsafe internal bool TryLoad( SteamNative.SteamUtils utils ) if ( utils.GetImageRGBA( Id, (IntPtr) ptr, buffer.Length ) == false ) { IsError = true; - return true; + return false; } } diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index 3d79a4e..f2c324e 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -32,10 +32,13 @@ public static void ForUnity( string platform ) } IsUnity = true; + UseThisCall = SteamNative.Platform.Os == OperatingSystem.Windows; Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch ); + + } /// @@ -47,7 +50,7 @@ public static void ForUnity( string platform ) /// for releasing his shit open source under the MIT license so we can all learn and iterate. /// /// - internal static bool UseThisCall { get { return SteamNative.Platform.Os == OperatingSystem.Windows && !IsUnity; } } + public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows; /// From bf2a07454711fe27b6c39d4627b94d1b0c9765ef Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 19 Feb 2018 14:36:07 +0000 Subject: [PATCH 22/40] Added finalizer, less chance of crashing with unity editor stop plays missing dispose --- Facepunch.Steamworks/BaseSteamworks.cs | 9 +++++++++ Facepunch.Steamworks/Client.cs | 7 +++++++ Facepunch.Steamworks/Server.cs | 7 +++++++ 3 files changed, 23 insertions(+) diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 036432d..9df2019 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -26,6 +26,7 @@ public class BaseSteamworks : IDisposable private List CallbackHandles = new List(); private List CallResults = new List(); + protected bool disposed = false; protected BaseSteamworks( uint appId ) @@ -39,8 +40,15 @@ protected BaseSteamworks( uint appId ) System.Environment.SetEnvironmentVariable("SteamGameId", AppId.ToString()); } + ~BaseSteamworks() + { + Dispose(); + } + public virtual void Dispose() { + if ( disposed ) return; + Callbacks.Clear(); foreach ( var h in CallbackHandles ) @@ -81,6 +89,7 @@ public virtual void Dispose() System.Environment.SetEnvironmentVariable("SteamAppId", null ); System.Environment.SetEnvironmentVariable("SteamGameId", null ); + disposed = true; } protected void SetupCommonInterfaces() diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index badfc21..f2feda0 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -135,6 +135,11 @@ public Client( uint appId ) : base( appId ) Update(); } + ~Client() + { + Dispose(); + } + /// /// Should be called at least once every frame /// @@ -163,6 +168,8 @@ public void RunCallbacks() /// public override void Dispose() { + if ( disposed ) return; + if ( Voice != null ) { Voice = null; diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs index f4947ee..5deb113 100644 --- a/Facepunch.Steamworks/Server.cs +++ b/Facepunch.Steamworks/Server.cs @@ -83,6 +83,11 @@ public Server( uint appId, ServerInit init) : base( appId ) Update(); } + ~Server() + { + Dispose(); + } + /// /// Should be called at least once every frame /// @@ -256,6 +261,8 @@ public void UpdatePlayer( ulong steamid, string name, int score ) /// public override void Dispose() { + if ( disposed ) return; + if ( Query != null ) { Query = null; From 63b31976c04da4f50cc80b1f3d66f2503e09cbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Straubmeier?= Date: Tue, 20 Feb 2018 11:55:59 +0100 Subject: [PATCH 23/40] Workshop.Item.Download returns a boolean --- Facepunch.Steamworks/Interfaces/Workshop.Item.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs b/Facepunch.Steamworks/Interfaces/Workshop.Item.cs index 21d943d..24fda87 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.Item.cs @@ -48,19 +48,20 @@ internal static Item From( SteamNative.SteamUGCDetails_t details, Workshop works return item; } - public void Download( bool highPriority = true ) + public bool Download( bool highPriority = true ) { - if ( Installed ) return; - if ( Downloading ) return; + if ( Installed ) return true; + if ( Downloading ) return true; if ( !workshop.ugc.DownloadItem( Id, highPriority ) ) { Console.WriteLine( "Download Failed" ); - return; + return false; } workshop.OnFileDownloaded += OnFileDownloaded; workshop.OnItemInstalled += OnItemInstalled; + return true; } public void Subscribe() From 6b5f8f7481a1d4a75d7c0068fe83b71791e37dae Mon Sep 17 00:00:00 2001 From: Daniel Menard Date: Tue, 20 Feb 2018 15:55:38 -0500 Subject: [PATCH 24/40] Added method to show friends invite overlay to Lobby class --- Facepunch.Steamworks/Client/Lobby.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index bcf8afe..df9c0a5 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -480,6 +480,14 @@ internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback ) } + /// + /// 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 /// From 2474c3de99cd574f4a079164b71acf263362da05 Mon Sep 17 00:00:00 2001 From: Daniel Menard Date: Fri, 23 Feb 2018 13:31:50 -0500 Subject: [PATCH 25/40] Added ability to register to OnLobbyJoinRequested callback --- Facepunch.Steamworks/Client/Lobby.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index df9c0a5..ccca631 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -37,6 +37,9 @@ public Lobby( Client c ) { client = c; + // For backwards compatibility + OnLobbyJoinRequested = Join; + client.RegisterCallback( OnLobbyDataUpdatedAPI ); client.RegisterCallback( OnLobbyChatMessageRecievedAPI ); client.RegisterCallback( OnLobbyStateUpdatedAPI ); @@ -493,12 +496,17 @@ public void OpenFriendInviteOverlay() /// 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 ) { - Join( callback.SteamIDLobby ); + if (OnLobbyJoinRequested != null) { OnLobbyJoinRequested(callback.SteamIDLobby); } } /// From 2fb0df5ae3070b91a645f6d3085695c3500f1195 Mon Sep 17 00:00:00 2001 From: Jesse Fish Date: Tue, 13 Mar 2018 20:11:28 -0700 Subject: [PATCH 26/40] Correctly handle lobby refresh with null filter Currently if a null filter is given, more filters are added to the call than expected. This change makes a lobby request after the appid filter is added and returns immediately resolving the issue. --- Facepunch.Steamworks/Client/LobbyList.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Facepunch.Steamworks/Client/LobbyList.cs b/Facepunch.Steamworks/Client/LobbyList.cs index a8ed9a2..4470973 100644 --- a/Facepunch.Steamworks/Client/LobbyList.cs +++ b/Facepunch.Steamworks/Client/LobbyList.cs @@ -41,6 +41,8 @@ public void Refresh ( Filter 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); From ebef55c42802410365360361e951632b2135d87c Mon Sep 17 00:00:00 2001 From: kscarlett Date: Wed, 14 Mar 2018 11:09:00 +0000 Subject: [PATCH 27/40] Fixed documentation comment for Lobby.Create() --- Facepunch.Steamworks/Client/Lobby.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index ccca631..fb2c163 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -92,7 +92,7 @@ void OnLobbyJoinedAPI( LobbyEnter_t callback, bool error ) public Action OnLobbyJoined; /// - /// Creates a lobby and returns the created lobby. You auto join the created lobby. The lobby is stored in Client.CurrentLobby if successful. + /// 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 From 99c77f1997c71ceb12ac9762f1e7d44b196b8b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Straubmeier?= Date: Mon, 19 Mar 2018 19:36:06 +0100 Subject: [PATCH 28/40] Inventory.FetchItemDefinitions is now public --- Facepunch.Steamworks/Interfaces/Inventory.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index 2245fcf..3953256 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -48,7 +48,6 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo Result.Pending = new Dictionary(); - inventory.LoadItemDefinitions(); FetchItemDefinitions(); UpdatePrices(); @@ -198,12 +197,17 @@ public Definition CreateDefinition( int id ) return new Definition( this, id ); } - internal void FetchItemDefinitions() + /// + /// Fetch item definitions in case new ones have been added since we've initialized + /// + public void FetchItemDefinitions() { // // Make sure item definitions are loaded, because we're going to be using them. // + inventory.LoadItemDefinitions(); + var ids = inventory.GetItemDefinitionIDs(); if ( ids == null ) return; @@ -238,7 +242,6 @@ public void Update() } FetchItemDefinitions(); - inventory.LoadItemDefinitions(); } } From a40334551b0b72be586bc9ea9aa4b5e52f3122ee Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 10:42:55 +0000 Subject: [PATCH 29/40] Added missing callbacks --- .../SteamNative/SteamNative.Constants.cs | 2 + .../SteamNative/SteamNative.Structs.cs | 1832 +++++++++++++++++ Generator/CodeParser/CodeParser.cs | 28 +- Generator/CodeWriter/Struct.cs | 4 +- Generator/Program.cs | 5 + Generator/steam_api_missing.json | 506 +++-- 6 files changed, 2144 insertions(+), 233 deletions(-) diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs index 411274d..802775a 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs @@ -41,6 +41,7 @@ internal static class CallbackIdentifiers public const int ClientRemoteClientManager = 3300; public const int ClientUGC = 3400; public const int SteamStreamClient = 3500; + public const int ClientProductBuilder = 3600; public const int ClientShortcuts = 3700; public const int ClientRemoteControlManager = 3800; public const int SteamAppList = 3900; @@ -54,6 +55,7 @@ internal static class CallbackIdentifiers public const int ClientInventory = 4700; public const int ClientBluetoothManager = 4800; public const int ClientSharedConnection = 4900; + public const int SteamParentalSettings = 5000; public const int ClientShader = 5100; } internal static class Defines diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index 59171f3..a37a3c1 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -29617,6 +29617,1827 @@ internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.S } } + [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 ) @@ -29783,6 +31604,17 @@ internal static void RegisterCallbacks( Facepunch.Steamworks.BaseSteamworks stea 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/Generator/CodeParser/CodeParser.cs b/Generator/CodeParser/CodeParser.cs index 99505b7..caefe23 100644 --- a/Generator/CodeParser/CodeParser.cs +++ b/Generator/CodeParser/CodeParser.cs @@ -29,12 +29,12 @@ internal void ExtendDefinition( SteamApiDefinition def ) // def.CallbackIds = new Dictionary(); { - var r = new Regex( @"enum { (k_i(?:.+)) = ([0-9]+) };" ); + var r = new Regex( @"enum { (k_[i|I](?:.+)) = ([0-9]+) };" ); var ma = r.Matches( Content ); foreach ( Match m in ma ) { - def.CallbackIds.Add( m.Groups[1].Value.Replace( "k_i", "" ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) ); + def.CallbackIds.Add( m.Groups[1].Value.Substring( 3 ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) ); } } @@ -62,7 +62,7 @@ internal void ExtendDefinition( SteamApiDefinition def ) num = "0"; } - kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); + kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" ); t.CallbackId = $"{kName} + {num}"; } @@ -77,7 +77,8 @@ internal void ExtendDefinition( SteamApiDefinition def ) var kName = m.Groups[1].Value; var num = m.Groups[2].Value; - kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); + //kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); + kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" ); t.CallbackId = $"{kName} + {num}"; } @@ -119,6 +120,25 @@ internal void ExtendDefinition( SteamApiDefinition def ) } } + // + // Find missing structs + // + { + var r = new Regex( @"struct ([a-zA-Z]+_t)" ); + var ma = r.Matches( Content ); + + foreach ( Match m in ma ) + { + var s = def.structs.SingleOrDefault( x => x.Name == m.Groups[1].Value ); + if ( s == null ) + { + Console.WriteLine( "Missing Struct: " + m.Groups[1].Value ); + } + } + + //Console.ReadKey(); + } + } } } diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 866d9ab..a79ecad 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -49,7 +49,7 @@ void Structs() int defaultPack = 8; - if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) ) + if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) ) defaultPack = 4; // @@ -60,7 +60,7 @@ void Structs() { if ( !string.IsNullOrEmpty( c.CallbackId ) ) { - WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" ); + WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" ); } // diff --git a/Generator/Program.cs b/Generator/Program.cs index 06e5d19..47512fb 100644 --- a/Generator/Program.cs +++ b/Generator/Program.cs @@ -32,6 +32,11 @@ private static void AddMissing( SteamApiDefinition output ) output.structs.AddRange( missing.structs ); output.methods.AddRange( missing.methods ); + + foreach ( var s in output.structs ) + { + if ( s.Fields == null ) s.Fields = new SteamApiDefinition.StructDef.StructFields[0]; + } } } } diff --git a/Generator/steam_api_missing.json b/Generator/steam_api_missing.json index 3a6a43e..642d738 100644 --- a/Generator/steam_api_missing.json +++ b/Generator/steam_api_missing.json @@ -1,229 +1,281 @@ { - structs: - [ - { - struct: "ItemInstalled_t", - fields: - [ - { - fieldname: "m_unAppID", - fieldtype: "AppId_t" - }, - { - fieldname: "m_nPublishedFileId", - fieldtype: "PublishedFileId_t" - } - ] - } - ], - - 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" - } - ], - }, - ] + "structs": + [ + { + "struct": "ItemInstalled_t", + "fields": + [ + { + "fieldname": "m_unAppID", + "fieldtype": "AppId_t" + }, + { + "fieldname": "m_nPublishedFileId", + "fieldtype": "PublishedFileId_t" + } + ] + }, + + + { + "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 *" + } + ] + }, + + + { + "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 From 144f401d2c7f6fd39e30c87d8f6e49baad7f708f Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 11:17:46 +0000 Subject: [PATCH 30/40] Register callbacks before setting up interfaces --- Facepunch.Steamworks/Client.cs | 10 +++++----- Facepunch.Steamworks/Server.cs | 12 +++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index f2feda0..677dfaa 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -84,17 +84,17 @@ public Client( uint appId ) : base( appId ) return; } - // - // Setup interfaces that client and server both have - // - SetupCommonInterfaces(); - // // Register Callbacks // SteamNative.Callbacks.RegisterCallbacks( this ); + // + // Setup interfaces that client and server both have + // + SetupCommonInterfaces(); + // // Client only interfaces // diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs index 5deb113..1aca880 100644 --- a/Facepunch.Steamworks/Server.cs +++ b/Facepunch.Steamworks/Server.cs @@ -47,17 +47,19 @@ public Server( uint appId, ServerInit init) : base( appId ) return; } - // - // Setup interfaces that client and server both have - // - SetupCommonInterfaces(); - // // Register Callbacks // SteamNative.Callbacks.RegisterCallbacks( this ); + // + // Setup interfaces that client and server both have + // + SetupCommonInterfaces(); + + + // // Initial settings // From 7b7cfa29c4b4bfa2128e17f6ea7a7984d4aebaa8 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 11:27:18 +0000 Subject: [PATCH 31/40] Added Inventory.OnDefinitionsUpdated --- .../Client/InventoryTest.cs | 42 ++++++++++ Facepunch.Steamworks/BaseSteamworks.cs | 12 ++- Facepunch.Steamworks/Interfaces/Inventory.cs | 78 ++++++++++--------- 3 files changed, 93 insertions(+), 39 deletions(-) diff --git a/Facepunch.Steamworks.Test/Client/InventoryTest.cs b/Facepunch.Steamworks.Test/Client/InventoryTest.cs index 1bcdb8d..837b1b8 100644 --- a/Facepunch.Steamworks.Test/Client/InventoryTest.cs +++ b/Facepunch.Steamworks.Test/Client/InventoryTest.cs @@ -15,6 +15,12 @@ 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 ); @@ -36,6 +42,12 @@ 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 ); @@ -58,6 +70,12 @@ 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 ); @@ -80,6 +98,12 @@ 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 @@ -146,6 +170,12 @@ 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); @@ -202,6 +232,12 @@ 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); @@ -235,6 +271,12 @@ 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); diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 9df2019..7d19b7b 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -128,8 +128,6 @@ internal void UnregisterCallResult( SteamNative.CallResult handle ) public virtual void Update() { - Inventory.Update(); - Networking.Update(); RunUpdateCallbacks(); @@ -169,6 +167,11 @@ public void UpdateWhile( Func func ) } } + /// + /// 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 ) @@ -192,6 +195,11 @@ internal void OnCallback( T data ) { i( data ); } + + if ( OnAnyCallback != null ) + { + OnAnyCallback.Invoke( data ); + } } internal void RegisterCallback( Action func ) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index 3953256..bc00919 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -37,24 +37,26 @@ public partial class Inventory : IDisposable internal SteamNative.SteamInventory inventory; - private Stopwatch fetchRetryTimer; - 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(); - UpdatePrices(); + FetchItemDefinitions(); // onDefinitionsUpdated should get called on next Update if ( !server ) { steamworks.RegisterCallback( onResultReady ); steamworks.RegisterCallback( onFullUpdate ); + // // Get a list of our items immediately @@ -63,6 +65,37 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo } } + /// + /// Should get called when the definitions get updated from Steam. + /// + private void onDefinitionsUpdated( SteamInventoryDefinitionUpdate_t obj ) + { + Console.WriteLine( "onDefinitionsUpdated" ); + 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 /// @@ -202,22 +235,7 @@ public Definition CreateDefinition( int id ) /// public void FetchItemDefinitions() { - // - // Make sure item definitions are loaded, because we're going to be using them. - // - inventory.LoadItemDefinitions(); - - var ids = inventory.GetItemDefinitionIDs(); - if ( ids == null ) - return; - - Definitions = ids.Select( x => CreateDefinition( x ) ).ToArray(); - - foreach ( var def in Definitions ) - { - def.Link( Definitions ); - } } /// @@ -225,24 +243,7 @@ public void FetchItemDefinitions() /// public void Update() { - if ( Definitions == null ) - { - // - // Don't try every frame, just try every 10 seconds. - // - { - if ( fetchRetryTimer != null && fetchRetryTimer.Elapsed.TotalSeconds < 10.0f ) - return; - if ( fetchRetryTimer == null ) - fetchRetryTimer = Stopwatch.StartNew(); - - fetchRetryTimer.Reset(); - fetchRetryTimer.Start(); - } - - FetchItemDefinitions(); - } } /// @@ -258,7 +259,10 @@ public IEnumerable DefinitionsWithPrices { get { - for( int i=0; i< Definitions.Length; i++ ) + if ( Definitions == null ) + yield break; + + for ( int i=0; i< Definitions.Length; i++ ) { if (Definitions[i].LocalPrice > 0) yield return Definitions[i]; From 372052a7fbbfcaa5ae303d52e7081fa6f9cfe9da Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 11:46:43 +0000 Subject: [PATCH 32/40] Nuget settings --- Facepunch.Steamworks/Facepunch.Steamworks.csproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj index 2750edb..e72ed9e 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.csproj @@ -8,6 +8,7 @@ true false + true @@ -35,6 +36,13 @@ 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 From e94866828a560c39f47318552e68f41ae36eed0a Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 12:39:43 +0000 Subject: [PATCH 33/40] Fixed avatars sometimes not loading --- Facepunch.Steamworks/Client/Friends.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 00bea27..00d5f45 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -40,6 +40,7 @@ internal Friends( Client c ) { client = c; + client.RegisterCallback( OnAvatarImageLoaded ); client.RegisterCallback( OnPersonaStateChange ); client.RegisterCallback( OnGameJoinRequested ); client.RegisterCallback( OnFriendChatMessage ); @@ -237,8 +238,9 @@ public Image GetCachedAvatar( AvatarSize size, ulong steamid ) break; } - if ( imageid >= 0 && imageid <= 10 ) - return null; + 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() { @@ -315,7 +317,7 @@ internal void Cycle() var timeOut = DateTime.Now.AddSeconds( -10 ); - for ( int i = 0; i < PersonaCallbacks.Count; i++ ) + for ( int i = PersonaCallbacks.Count-1; i >= 0; i-- ) { var cb = PersonaCallbacks[i]; @@ -338,10 +340,16 @@ private void OnPersonaStateChange( PersonaStateChange_t data ) { if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar - for ( int i=0; i< PersonaCallbacks.Count; i++ ) + LoadForSteamid( data.SteamID ); + + } + + void LoadForSteamid( ulong Steamid ) + { + for ( int i = PersonaCallbacks.Count - 1; i >= 0; i-- ) { var cb = PersonaCallbacks[i]; - if ( cb.SteamId != data.SteamID ) continue; + if ( cb.SteamId != Steamid ) continue; var image = GetCachedAvatar( cb.Size, cb.SteamId ); if ( image == null ) continue; @@ -355,5 +363,10 @@ private void OnPersonaStateChange( PersonaStateChange_t data ) } } + private void OnAvatarImageLoaded( AvatarImageLoaded_t data ) + { + LoadForSteamid( data.SteamID ); + } + } } From 835770772f2a97565119cf6620241cc16f25253b Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 13:11:25 +0000 Subject: [PATCH 34/40] IPAddress Cleanup --- .../Client/ServerlistTest.cs | 18 ++++++++++++++++ Facepunch.Steamworks/Interfaces/Inventory.cs | 1 - Facepunch.Steamworks/Server.cs | 6 ++++-- Facepunch.Steamworks/Server/ServerInit.cs | 3 ++- Facepunch.Steamworks/Utility.cs | 21 +++++++++---------- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs index bba5e01..6fa37a0 100644 --- a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs +++ b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Text; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -12,6 +13,23 @@ namespace Facepunch.Steamworks.Test [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() { diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index bc00919..eff2da8 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -70,7 +70,6 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo /// private void onDefinitionsUpdated( SteamInventoryDefinitionUpdate_t obj ) { - Console.WriteLine( "onDefinitionsUpdated" ); LoadDefinitions(); UpdatePrices(); diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs index 1aca880..e2091c0 100644 --- a/Facepunch.Steamworks/Server.cs +++ b/Facepunch.Steamworks/Server.cs @@ -33,13 +33,15 @@ public Server( uint appId, ServerInit init) : base( appId ) 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, init.IpAddress, init.SteamPort, init.GamePort, init.QueryPort, init.Secure ? 3 : 2, init.VersionString ) ) + if ( !native.InitServer( this, ipaddress, init.SteamPort, init.GamePort, init.QueryPort, init.Secure ? 3 : 2, init.VersionString ) ) { native.Dispose(); native = null; @@ -300,7 +302,7 @@ public System.Net.IPAddress PublicIp var ip = native.gameServer.GetPublicIP(); if ( ip == 0 ) return null; - return new System.Net.IPAddress( Utility.SwapBytes( ip ) ); + return Utility.Int32ToIp( ip ); } } diff --git a/Facepunch.Steamworks/Server/ServerInit.cs b/Facepunch.Steamworks/Server/ServerInit.cs index b4787a2..d4117ec 100644 --- a/Facepunch.Steamworks/Server/ServerInit.cs +++ b/Facepunch.Steamworks/Server/ServerInit.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Runtime.InteropServices; using System.Text; @@ -12,7 +13,7 @@ namespace Facepunch.Steamworks /// public class ServerInit { - public uint IpAddress = 0; + public IPAddress IpAddress; public ushort SteamPort; public ushort GamePort = 27015; public ushort QueryPort = 27016; diff --git a/Facepunch.Steamworks/Utility.cs b/Facepunch.Steamworks/Utility.cs index 7b048cc..bbd5764 100644 --- a/Facepunch.Steamworks/Utility.cs +++ b/Facepunch.Steamworks/Utility.cs @@ -6,25 +6,24 @@ namespace Facepunch.Steamworks { - internal static class Utility + public static class Utility { - static internal uint SwapBytes( uint x ) + static internal uint Swap( uint x ) { - return ( ( x & 0x000000ff ) << 24 ) + - ( ( x & 0x0000ff00 ) << 8 ) + - ( ( x & 0x00ff0000 ) >> 8 ) + - ( ( x & 0xff000000 ) >> 24 ); + return ((x & 0x000000ff) << 24) + + ((x & 0x0000ff00) << 8) + + ((x & 0x00ff0000) >> 8) + + ((x & 0xff000000) >> 24); } - - static internal uint IpToInt32( this IPAddress ipAddress ) + static public uint IpToInt32( this IPAddress ipAddress ) { - return BitConverter.ToUInt32( ipAddress.GetAddressBytes().Reverse().ToArray(), 0 ); + return Swap( (uint) ipAddress.Address ); } - static internal IPAddress Int32ToIp( uint ipAddress ) + static public IPAddress Int32ToIp( uint ipAddress ) { - return new IPAddress( BitConverter.GetBytes( ipAddress ).Reverse().ToArray() ); + return new IPAddress( Swap( ipAddress ) ); } static internal class Epoch From 80bf89c9e6a827c41e81dbe8c65451d2f697b638 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 21 Mar 2018 14:41:59 +0000 Subject: [PATCH 35/40] Fixed inventory.item reliance on definition --- .../Interfaces/Inventory.Item.cs | 48 ++++++++++++++----- .../Interfaces/Inventory.Result.cs | 11 +---- Facepunch.Steamworks/Interfaces/Inventory.cs | 15 ++++-- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs b/Facepunch.Steamworks/Interfaces/Inventory.Item.cs index 2240ee3..84c4383 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Item.cs @@ -11,8 +11,16 @@ public partial class Inventory /// /// An item in your inventory. /// - public struct Item : IEquatable + 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; @@ -24,12 +32,26 @@ public struct Amount 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; + public Definition Definition + { + get + { + if ( _cachedDefinition != null ) + return _cachedDefinition; + + _cachedDefinition = Inventory.FindDefinition( DefinitionId ); + return _cachedDefinition; + } + } public bool TradeLocked; @@ -73,10 +95,10 @@ public override int GetHashCode() public Result Consume( int amount = 1 ) { SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !Definition.inventory.inventory.ConsumeItem( ref resultHandle, Id, (uint)amount ) ) + if ( !Inventory.inventory.ConsumeItem( ref resultHandle, Id, (uint)amount ) ) return null; - return new Result( Definition.inventory, resultHandle, true ); + return new Result( Inventory, resultHandle, true ); } /// @@ -85,10 +107,10 @@ public Result Consume( int amount = 1 ) public Result SplitStack( int quantity = 1 ) { SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !Definition.inventory.inventory.TransferItemQuantity( ref resultHandle, Id, (uint)quantity, ulong.MaxValue ) ) + if ( !Inventory.inventory.TransferItemQuantity( ref resultHandle, Id, (uint)quantity, ulong.MaxValue ) ) return null; - return new Result( Definition.inventory, resultHandle, true ); + return new Result( Inventory, resultHandle, true ); } SteamNative.SteamInventoryUpdateHandle_t updateHandle; @@ -97,35 +119,35 @@ private void UpdatingProperties() { if (updateHandle != 0) return; - updateHandle = Definition.inventory.inventory.StartUpdateProperties(); + updateHandle = Inventory.inventory.StartUpdateProperties(); } public bool SetProperty( string name, string value ) { UpdatingProperties(); Properties[name] = value.ToString(); - return Definition.inventory.inventory.SetProperty(updateHandle, Id, name, value); + return Inventory.inventory.SetProperty(updateHandle, Id, name, value); } public bool SetProperty(string name, bool value) { UpdatingProperties(); Properties[name] = value.ToString(); - return Definition.inventory.inventory.SetProperty0(updateHandle, Id, name, value); + return Inventory.inventory.SetProperty0(updateHandle, Id, name, value); } public bool SetProperty(string name, long value) { UpdatingProperties(); Properties[name] = value.ToString(); - return Definition.inventory.inventory.SetProperty1(updateHandle, Id, name, value); + return Inventory.inventory.SetProperty1(updateHandle, Id, name, value); } public bool SetProperty(string name, float value) { UpdatingProperties(); Properties[name] = value.ToString(); - return Definition.inventory.inventory.SetProperty2(updateHandle, Id, name, value); + return Inventory.inventory.SetProperty2(updateHandle, Id, name, value); } /// @@ -140,12 +162,12 @@ public bool SubmitProperties() { SteamNative.SteamInventoryResult_t result = -1; - if (!Definition.inventory.inventory.SubmitUpdateProperties(updateHandle, ref result)) + if (!Inventory.inventory.SubmitUpdateProperties(updateHandle, ref result)) { return false; } - Definition.inventory.inventory.DestroyResult(result); + Inventory.inventory.DestroyResult(result); return true; } diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs index 3f1bfa2..68935bb 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs @@ -194,15 +194,8 @@ internal Item ItemFrom( SteamInventoryResult_t handle, SteamItemDetails_t detail } } - var item = new Item() - { - Quantity = detail.Quantity, - Id = detail.ItemId, - DefinitionId = detail.Definition, - TradeLocked = ((int)detail.Flags & (int)SteamNative.SteamItemFlags.NoTrade) != 0, - Definition = FindDefinition(detail.Definition), - Properties = props - }; + 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 index eff2da8..c0517e3 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -50,7 +50,9 @@ internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, boo Result.Pending = new Dictionary(); - FetchItemDefinitions(); // onDefinitionsUpdated should get called on next Update + FetchItemDefinitions(); + LoadDefinitions(); + UpdatePrices(); if ( !server ) { @@ -287,14 +289,19 @@ public static float PriceCategoryToFloat( string price ) } /// - /// You really need me to explain what this does? - /// Use your brains. + /// 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; - return Definitions.FirstOrDefault( x => x.Id == DefinitionId ); + 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 ) From 476321c026cd170d8dc6752de39d9c438ebdaa9d Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 27 Mar 2018 10:21:11 +0100 Subject: [PATCH 36/40] Keep friend status up to date via PersonaStateChange_t --- Facepunch.Steamworks/Client/Friends.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 00d5f45..0a95d0a 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -338,13 +338,24 @@ internal void Cycle() private void OnPersonaStateChange( PersonaStateChange_t data ) { - if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar + // k_EPersonaChangeAvatar + if ( (data.ChangeFlags & 0x0040) == 0x0040 ) + { + LoadAvatarForSteamId( data.SteamID ); + } - LoadForSteamid( data.SteamID ); + // + // Find and refresh this friend's status + // + foreach ( var friend in All ) + { + if ( friend.Id != data.SteamID ) continue; + friend.Refresh(); + } } - void LoadForSteamid( ulong Steamid ) + void LoadAvatarForSteamId( ulong Steamid ) { for ( int i = PersonaCallbacks.Count - 1; i >= 0; i-- ) { @@ -365,7 +376,7 @@ void LoadForSteamid( ulong Steamid ) private void OnAvatarImageLoaded( AvatarImageLoaded_t data ) { - LoadForSteamid( data.SteamID ); + LoadAvatarForSteamId( data.SteamID ); } } From 9270eaef07fe2856d86bdb47f303247b4043d1f2 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 27 Mar 2018 12:29:34 +0100 Subject: [PATCH 37/40] Server Rules Query uses a custom UdpClient instead of doing it through Steam, avoiding all the nasty vtable building junk --- .../Client/ServerlistTest.cs | 25 +- Facepunch.Steamworks/BaseSteamworks.cs | 7 + .../Client/ServerList.Server.cs | 17 +- Facepunch.Steamworks/Client/ServerQuery.cs | 513 ------------------ Facepunch.Steamworks/Interop/ServerRules.cs | 171 ------ Facepunch.Steamworks/Utility.cs | 22 +- .../Utility/SourceServerQuery.cs | 206 +++++++ 7 files changed, 259 insertions(+), 702 deletions(-) delete mode 100644 Facepunch.Steamworks/Client/ServerQuery.cs delete mode 100644 Facepunch.Steamworks/Interop/ServerRules.cs create mode 100644 Facepunch.Steamworks/Utility/SourceServerQuery.cs diff --git a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs index 6fa37a0..9f5b413 100644 --- a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs +++ b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs @@ -45,7 +45,7 @@ public void InternetList() for ( int i = 0; i < 1000; i++ ) { client.Update(); - System.Threading.Thread.Sleep( 5 ); + System.Threading.Thread.Sleep( 100 ); foreach ( var s in query.Responded ) { @@ -425,20 +425,21 @@ public void Rules() query.Dispose(); - foreach ( var server in query.Responded.Take( 20 ) ) - { - GC.Collect(); - server.FetchRules(); - GC.Collect(); + var servers = query.Responded.Take( 10 ); + foreach ( var server in servers ) + { + server.FetchRules(); + } + + foreach ( var server in servers ) + { int i = 0; while ( !server.HasRules ) { i++; - GC.Collect(); client.Update(); - GC.Collect(); - System.Threading.Thread.Sleep( 2 ); + System.Threading.Thread.Sleep( 10 ); if ( i > 100 ) break; @@ -446,11 +447,17 @@ public void Rules() if ( server.HasRules ) { + Console.WriteLine( "SERVER HAS RULES :D" ); + foreach ( var rule in server.Rules ) { Console.WriteLine( rule.Key + " = " + rule.Value ); } } + else + { + Console.WriteLine( "SERVER HAS NO RULES :(" ); + } } diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 7d19b7b..e32744c 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -145,6 +145,13 @@ public void RunUpdateCallbacks() { 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(); } /// diff --git a/Facepunch.Steamworks/Client/ServerList.Server.cs b/Facepunch.Steamworks/Client/ServerList.Server.cs index a750f2d..fbe10b8 100644 --- a/Facepunch.Steamworks/Client/ServerList.Server.cs +++ b/Facepunch.Steamworks/Client/ServerList.Server.cs @@ -86,7 +86,7 @@ internal static Server FromSteam( Client client, SteamNative.gameserveritem_t it /// public bool HasRules { get { return Rules != null && Rules.Count > 0; } } - internal Interop.ServerRules RulesRequest; + internal SourceServerQuery RulesRequest; /// /// Populates Rules for this server @@ -96,18 +96,23 @@ public void FetchRules() if ( RulesRequest != null ) return; - Rules = new Dictionary(); - - RulesRequest = new Interop.ServerRules( this, Address, QueryPort ); + Rules = null; + RulesRequest = new SourceServerQuery( this, Address, QueryPort ); } - internal void OnServerRulesReceiveFinished( bool Success ) + internal void OnServerRulesReceiveFinished( Dictionary rules, bool Success ) { - RulesRequest.Dispose(); RulesRequest = null; + if ( Success ) + { + Rules = rules; + } + if ( OnReceivedRules != null ) + { OnReceivedRules( Success ); + } } internal const uint k_unFavoriteFlagNone = 0x00; diff --git a/Facepunch.Steamworks/Client/ServerQuery.cs b/Facepunch.Steamworks/Client/ServerQuery.cs deleted file mode 100644 index b1abaac..0000000 --- a/Facepunch.Steamworks/Client/ServerQuery.cs +++ /dev/null @@ -1,513 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Net; -using System.Net.Sockets; -using System.IO; - -#if !NET_CORE - -internal class SourceServerQuery :IDisposable -{ - public class PlayersResponse - { - public short player_count; - public List players = new List(); - - public class Player - { - public String name { get; set; } - public int score { get; set; } - public float playtime { get; set; } - } - } - - private IPEndPoint endPoint; - - private Socket socket; - private UdpClient client; - - // send & receive timeouts - private int send_timeout = 2500; - private int receive_timeout = 2500; - - // raw response returned from the server - private byte[] raw_data; - - private int offset = 0; - - // constants - private readonly byte[] FFFFFFFF = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF }; - - public SourceServerQuery( String ip, int port ) - { - this.endPoint = new IPEndPoint( IPAddress.Parse( ip ), port ); - } - - /// - /// Get a list of currently in-game clients on the specified gameserver. - /// Please note: the playtime is stored as a float in seconds, you might want to convert it. - /// - /// See https://developer.valvesoftware.com/wiki/Server_queries#A2S_PLAYER for more Information - /// - /// A PLayersResponse Object containing the name, score and playtime of each player - public PlayersResponse GetPlayerList() - { - // open socket if not already open - this.GetSocket(); - // we don't need the header, so set pointer to where the payload begins - this.offset = 5; - - try - { - PlayersResponse pr = new PlayersResponse(); - - // since A2S_PLAYER requests require a valid challenge, get it first - byte[] challenge = this.GetChallenge(0x55, true); - - byte[] request = new byte[challenge.Length + this.FFFFFFFF.Length + 1]; - Array.Copy( this.FFFFFFFF, 0, request, 0, this.FFFFFFFF.Length ); - request[this.FFFFFFFF.Length] = 0x55; - Array.Copy( challenge, 0, request, this.FFFFFFFF.Length + 1, challenge.Length ); - - this.socket.Send( request ); - - // MODIFIED BY ZACKBOE - // Increased byte size from 1024 in order to receive more player data - // Previously returned a socket exception at >~ 51 players. - this.raw_data = new byte[2048]; - // END MODIFICATION - this.socket.Receive( this.raw_data ); - - byte player_count = this.ReadByte(); - - // fill up the list of players - for ( int i = 0; i < player_count; i++ ) - { - this.ReadByte(); - - PlayersResponse.Player p = new PlayersResponse.Player(); - - p.name = this.ReadString(); - p.score = this.ReadInt32(); - p.playtime = this.ReadFloat(); - - pr.players.Add( p ); - } - - pr.player_count = player_count; - - return pr; - } - catch ( SocketException ) - { - return null; - } - } - - /// - /// Get a list of all publically available CVars ("rules") from the server. - /// Note: Due to a bug in the Source Engine, it might happen that some CVars/values are cut off. - /// - /// Example: mp_idlemaxtime = [nothing] - /// Only Valve can fix that. - /// - /// A RulesResponse Object containing a Name-Value pair of each CVar - public Dictionary GetRules() - { - // open udpclient if not already open - this.GetClient(); - - try - { - var d = new Dictionary(); - - // similar to A2S_PLAYER requests, A2S_RULES require a valid challenge - byte[] challenge = this.GetChallenge(0x56, false); - - byte[] request = new byte[challenge.Length + this.FFFFFFFF.Length + 1]; - Array.Copy( this.FFFFFFFF, 0, request, 0, this.FFFFFFFF.Length ); - request[this.FFFFFFFF.Length] = 0x56; - Array.Copy( challenge, 0, request, this.FFFFFFFF.Length + 1, challenge.Length ); - - this.client.Send( request, request.Length ); - - // - // Since A2S_RULES responses might be split up into several packages/compressed, we have to do a special handling of them - // - int bytesRead; - - // this will keep our assembled message - byte[] buffer = new byte[4096]; - - // send first request - - this.raw_data = this.client.Receive( ref this.endPoint ); - - bytesRead = this.raw_data.Length; - - // reset pointer - this.offset = 0; - - int is_split = this.ReadInt32(); - int requestid = this.ReadInt32(); - - this.offset = 4; - - // response is split up into several packets - if ( this.PacketIsSplit( is_split ) ) - { - bool isCompressed = false; - byte[] splitData; - int packetCount, packetNumber, requestId; - int packetsReceived = 1; - int packetChecksum = 0; - int packetSplit = 0; - short splitSize; - int uncompressedSize = 0; - List splitPackets = new List(); - - do - { - // unique request id - requestId = this.ReverseBytes( this.ReadInt32() ); - isCompressed = this.PacketIsCompressed( requestId ); - - packetCount = this.ReadByte(); - packetNumber = this.ReadByte() + 1; - // so we know how big our byte arrays have to be - splitSize = this.ReadInt16(); - splitSize -= 4; // fix - - if ( packetsReceived == 1 ) - { - for ( int i = 0; i < packetCount; i++ ) - { - splitPackets.Add( new byte[] { } ); - } - } - - // if the packets are compressed, get some data to decompress them - if ( isCompressed ) - { - uncompressedSize = ReverseBytes( this.ReadInt32() ); - packetChecksum = ReverseBytes( this.ReadInt32() ); - } - - // ommit header in first packet - if ( packetNumber == 1 ) this.ReadInt32(); - - splitData = new byte[splitSize]; - splitPackets[packetNumber - 1] = this.ReadBytes(); - - // fixes a case where the returned package might still contain a character after the last \0 terminator (truncated name => value) - // please note: this therefore also removes the value of said variable, but atleast the program won't crash - if ( splitPackets[packetNumber - 1].Length - 1 > 0 && splitPackets[packetNumber - 1][splitPackets[packetNumber - 1].Length - 1] != 0x00 ) - { - splitPackets[packetNumber - 1][splitPackets[packetNumber - 1].Length - 1] = 0x00; - } - - // reset pointer again, so we can copy over the contents - this.offset = 0; - - if ( packetsReceived < packetCount ) - { - - this.raw_data = this.client.Receive( ref this.endPoint ); - bytesRead = this.raw_data.Length; - - // continue with the next packets - packetSplit = this.ReadInt32(); - packetsReceived++; - } - else - { - // all packets received - bytesRead = 0; - } - } - while ( packetsReceived <= packetCount && bytesRead > 0 && packetSplit == -2 ); - - // decompress - if ( isCompressed ) - { - buffer = ReassemblePacket( splitPackets, true, uncompressedSize, packetChecksum ); - } - else - { - buffer = ReassemblePacket( splitPackets, false, 0, 0 ); - } - } - else - { - buffer = this.raw_data; - } - - // move our final result over to handle it - this.raw_data = buffer; - - // omitting header - this.offset += 1; - var count = this.ReadInt16(); - - for ( int i = 0; i < count; i++ ) - { - var k = this.ReadString(); - var v = this.ReadString(); - - if ( !d.ContainsKey( k ) ) - d.Add( k, v ); - } - - return d; - } - catch ( SocketException e ) - { - Console.WriteLine( e ); - return null; - } - } - - /// - /// Close all currently open socket/UdpClient connections - /// - public void Dispose() - { - if ( this.socket != null ) this.socket.Close(); - if ( this.client != null ) this.client.Close(); - } - - /// - /// Open up a new Socket-based connection to a server, if not already open. - /// - private void GetSocket() - { - if ( this.socket == null ) - { - this.socket = new Socket( - AddressFamily.InterNetwork, - SocketType.Dgram, - ProtocolType.Udp ); - - this.socket.SendTimeout = this.send_timeout; - this.socket.ReceiveTimeout = this.receive_timeout; - - this.socket.Connect( this.endPoint ); - } - } - - /// - /// Create a new UdpClient connection to a server (mostly used for multi-packet answers) - /// - private void GetClient() - { - if ( this.client == null ) - { - this.client = new UdpClient(); - this.client.Connect( this.endPoint ); - this.client.DontFragment = true; - - this.client.Client.SendTimeout = this.send_timeout; - this.client.Client.ReceiveTimeout = this.receive_timeout; - } - } - - /// - /// Reassmble a multi-packet response. - /// - /// The packets to assemble - /// true: packets are compressed; false: not - /// The size of the message after decompression (for comparison) - /// Validation of the result - /// A byte-array containing all packets assembled together/decompressed. - private byte[] ReassemblePacket( List splitPackets, bool isCompressed, int uncompressedSize, int packetChecksum ) - { - byte[] packetData, tmpData; - packetData = new byte[0]; - - foreach ( byte[] splitPacket in splitPackets ) - { - if ( splitPacket == null ) - { - throw new Exception(); - } - - tmpData = packetData; - packetData = new byte[tmpData.Length + splitPacket.Length]; - - MemoryStream memStream = new MemoryStream(packetData); - memStream.Write( tmpData, 0, tmpData.Length ); - memStream.Write( splitPacket, 0, splitPacket.Length ); - } - - if ( isCompressed ) - { - throw new System.NotImplementedException(); - } - - return packetData; - } - - /// - /// Invert the Byte-order Mark of an value, used for compatibility between Little Large BOM - /// - /// The value to invert - /// BOM-inversed value (if needed), otherwise the original value - private int ReverseBytes( int value ) - { - byte[] bytes = BitConverter.GetBytes(value); - if ( BitConverter.IsLittleEndian ) - { - Array.Reverse( bytes ); - } - return BitConverter.ToInt32( bytes, 0 ); - } - - /// - /// Determine whetever or not a message is compressed. - /// Simply detects if the most significant bit is 1. - /// - /// The value to check - /// true, if message is compressed, false otherwise - private bool PacketIsCompressed( int value ) - { - return ( value & 0x8000 ) != 0; - } - - /// - /// Determine whetever or not a message is split up. - /// - /// The value to check - /// true, if message is split up, false otherwise - private bool PacketIsSplit( int paket ) - { - return ( paket == -2 ); - } - - /// - /// Request the 4-byte challenge id from the server, required for A2S_RULES and A2S_PLAYER. - /// - /// The type of message to request the challenge for (see constants) - /// Request method to use (performance reasons) - /// A Byte Array (4-bytes) containing the challenge - private Byte[] GetChallenge( byte type, bool socket = true ) - { - byte[] request = new byte[this.FFFFFFFF.Length + this.FFFFFFFF.Length + 1]; - Array.Copy( this.FFFFFFFF, 0, request, 0, this.FFFFFFFF.Length ); - request[FFFFFFFF.Length] = type; - Array.Copy( this.FFFFFFFF, 0, request, this.FFFFFFFF.Length + 1, this.FFFFFFFF.Length ); - - byte[] raw_response = new byte[24]; - byte[] challenge = new byte[4]; - - // using sockets - if ( socket ) - { - this.socket.Send( request ); - this.socket.Receive( raw_response ); - } - else - { - this.client.Send( request, request.Length ); - raw_response = this.client.Receive( ref this.endPoint ); - } - - Array.Copy( raw_response, 5, challenge, 0, 4 ); // change this valve modifies the protocol! - - return challenge; - } - - /// - /// Read a single byte value from our raw data. - /// - /// A single Byte at the next Offset Address - private Byte ReadByte() - { - byte[] b = new byte[1]; - Array.Copy( this.raw_data, this.offset, b, 0, 1 ); - - this.offset++; - return b[0]; - } - - /// - /// Read all remaining Bytes from our raw data. - /// Used for multi-packet responses. - /// - /// All remaining data - private Byte[] ReadBytes() - { - int size = (this.raw_data.Length - this.offset - 4); - if ( size < 1 ) return new Byte[] { }; - - byte[] b = new byte[size]; - Array.Copy( this.raw_data, this.offset, b, 0, this.raw_data.Length - this.offset - 4 ); - - this.offset += ( this.raw_data.Length - this.offset - 4 ); - return b; - } - - /// - /// Read a 32-Bit Integer value from the next offset address. - /// - /// The Int32 Value found at the offset address - private Int32 ReadInt32() - { - byte[] b = new byte[4]; - Array.Copy( this.raw_data, this.offset, b, 0, 4 ); - - this.offset += 4; - return BitConverter.ToInt32( b, 0 ); - } - - /// - /// Read a 16-Bit Integer (also called "short") value from the next offset address. - /// - /// The Int16 Value found at the offset address - private Int16 ReadInt16() - { - byte[] b = new byte[2]; - Array.Copy( this.raw_data, this.offset, b, 0, 2 ); - - this.offset += 2; - return BitConverter.ToInt16( b, 0 ); - } - - /// - /// Read a Float value from the next offset address. - /// - /// The Float Value found at the offset address - private float ReadFloat() - { - byte[] b = new byte[4]; - Array.Copy( this.raw_data, this.offset, b, 0, 4 ); - - this.offset += 4; - return BitConverter.ToSingle( b, 0 ); - } - - /// - /// Read a String until its end starting from the next offset address. - /// Reading stops once the method detects a 0x00 Character at the next position (\0 terminator) - /// - /// The String read - private String ReadString() - { - byte[] cache = new byte[1] { 0x01 }; - String output = ""; - - while ( cache[0] != 0x00 ) - { - if ( this.offset == this.raw_data.Length ) break; // fixes Valve's inability to code a proper query protocol - Array.Copy( this.raw_data, this.offset, cache, 0, 1 ); - this.offset++; - - if ( cache[0] != 0x00) - output += Encoding.UTF8.GetString( cache ); - } - - return output; - } -} - -#endif \ No newline at end of file diff --git a/Facepunch.Steamworks/Interop/ServerRules.cs b/Facepunch.Steamworks/Interop/ServerRules.cs deleted file mode 100644 index 2cdb16a..0000000 --- a/Facepunch.Steamworks/Interop/ServerRules.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks.Interop -{ - class ServerRules : IDisposable - { - // Pins and pointers for the created vtable - private GCHandle vTablePin; - private IntPtr vTablePtr; - - // Pins for the functions - private GCHandle RulesRespondPin; - private GCHandle FailedRespondPin; - private GCHandle CompletePin; - - // The server that called us - private ServerList.Server Server; - - public ServerRules( ServerList.Server server, IPAddress address, int queryPort ) - { - Server = server; - - // - // Create a fake VTable to pass to c++ - // - InstallVTable(); - - // - // Ask Steam to get the server rules, respond to our fake vtable - // - Server.Client.native.servers.ServerRules( Utility.IpToInt32( address ), (ushort)queryPort, GetPtr() ); - } - - public void Dispose() - { - if ( vTablePtr != IntPtr.Zero ) - { - Marshal.FreeHGlobal( vTablePtr ); - vTablePtr = IntPtr.Zero; - } - - if ( vTablePin.IsAllocated ) - vTablePin.Free(); - - if ( RulesRespondPin.IsAllocated ) - RulesRespondPin.Free(); - - if ( FailedRespondPin.IsAllocated ) - FailedRespondPin.Free(); - - if ( CompletePin.IsAllocated ) - CompletePin.Free(); - } - - void InstallVTable() - { - - // - // Depending on platform, we either use ThisCall or stdcall. - // This is a bit of a fuckabout but you need to define Client.UseThisCall - // - - if ( Config.UseThisCall ) - { - ThisVTable.InternalRulesResponded da = ( _, k, v ) => InternalOnRulesResponded( k, v ); - ThisVTable.InternalRulesFailedToRespond db = ( _ ) => InternalOnRulesFailedToRespond(); - ThisVTable.InternalRulesRefreshComplete dc = ( _ ) => InternalOnRulesRefreshComplete(); - - RulesRespondPin = GCHandle.Alloc( da ); - FailedRespondPin = GCHandle.Alloc( db ); - CompletePin = GCHandle.Alloc( dc ); - - var t = new ThisVTable() - { - m_VTRulesResponded = da, - m_VTRulesFailedToRespond = db, - m_VTRulesRefreshComplete = dc, - }; - vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( ThisVTable ) ) ); - Marshal.StructureToPtr( t, vTablePtr, false ); - - vTablePin = GCHandle.Alloc( vTablePtr, GCHandleType.Pinned ); - - } - else - { - StdVTable.InternalRulesResponded da = InternalOnRulesResponded; - StdVTable.InternalRulesFailedToRespond db = InternalOnRulesFailedToRespond; - StdVTable.InternalRulesRefreshComplete dc = InternalOnRulesRefreshComplete; - - RulesRespondPin = GCHandle.Alloc( da ); - FailedRespondPin = GCHandle.Alloc( db ); - CompletePin = GCHandle.Alloc( dc ); - - var t = new StdVTable() - { - m_VTRulesResponded = da, - m_VTRulesFailedToRespond = db, - m_VTRulesRefreshComplete = dc - }; - vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( StdVTable ) ) ); - Marshal.StructureToPtr( t, vTablePtr, false ); - - vTablePin = GCHandle.Alloc( vTablePtr, GCHandleType.Pinned ); - } - } - - private void InternalOnRulesResponded( string k, string v ) - { - Server.Rules.Add( k, v ); - } - private void InternalOnRulesFailedToRespond() - { - Server.OnServerRulesReceiveFinished( false ); - } - private void InternalOnRulesRefreshComplete() - { - Server.OnServerRulesReceiveFinished( true ); - } - - [StructLayout( LayoutKind.Sequential )] - private class StdVTable - { - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesResponded m_VTRulesResponded; - - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesFailedToRespond m_VTRulesFailedToRespond; - - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesRefreshComplete m_VTRulesRefreshComplete; - - [UnmanagedFunctionPointer( CallingConvention.StdCall )] - public delegate void InternalRulesResponded( string pchRule, string pchValue ); - [UnmanagedFunctionPointer( CallingConvention.StdCall )] - public delegate void InternalRulesFailedToRespond(); - [UnmanagedFunctionPointer( CallingConvention.StdCall )] - public delegate void InternalRulesRefreshComplete(); - } - - [StructLayout( LayoutKind.Sequential )] - private class ThisVTable - { - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesResponded m_VTRulesResponded; - - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesFailedToRespond m_VTRulesFailedToRespond; - - [MarshalAs(UnmanagedType.FunctionPtr)] - public InternalRulesRefreshComplete m_VTRulesRefreshComplete; - - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate void InternalRulesResponded( IntPtr thisptr, string pchRule, string pchValue ); - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate void InternalRulesFailedToRespond( IntPtr thisptr ); - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate void InternalRulesRefreshComplete( IntPtr thisptr ); - } - - public System.IntPtr GetPtr() - { - return vTablePin.AddrOfPinnedObject(); - } - }; -} diff --git a/Facepunch.Steamworks/Utility.cs b/Facepunch.Steamworks/Utility.cs index bbd5764..1b86696 100644 --- a/Facepunch.Steamworks/Utility.cs +++ b/Facepunch.Steamworks/Utility.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net; using System.Text; namespace Facepunch.Steamworks { - public static class Utility + public static partial class Utility { static internal uint Swap( uint x ) { @@ -76,8 +77,23 @@ internal static string FormatPrice(string currency, ulong price) default: return $"{decimaled}{currency}"; } - - } + + public static string ReadAnsiString( 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.ASCII.GetString( buffer, 0, i ); + } + } } diff --git a/Facepunch.Steamworks/Utility/SourceServerQuery.cs b/Facepunch.Steamworks/Utility/SourceServerQuery.cs new file mode 100644 index 0000000..e831ac8 --- /dev/null +++ b/Facepunch.Steamworks/Utility/SourceServerQuery.cs @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; + +namespace Facepunch.Steamworks +{ + + internal class SourceServerQuery : IDisposable + { + public static List Current = new List(); + + public static void Cycle() + { + if ( Current.Count == 0 ) + return; + + for( int i = Current.Count; i>0; i-- ) + { + Current[i-1].Update(); + } + } + + 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 ) + { + try + { + using ( udpClient = new UdpClient() ) + { + udpClient.Client.SendTimeout = 3000; + udpClient.Client.ReceiveTimeout = 3000; + udpClient.Connect( endPoint ); + + GetRules(); + + IsSuccessful = true; + } + } + catch ( System.Exception ) + { + IsSuccessful = false; + } + + udpClient = null; + IsRunning = false; + } + + void GetRules() + { + GetChallengeData(); + + _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" ); + + var numRules = br.ReadUInt16(); + for ( int index = 0; index < numRules; index++ ) + { + rules.Add( br.ReadAnsiString( readBuffer ), br.ReadAnsiString( readBuffer ) ); + } + } + + } + + byte[] readBuffer = new byte[1024 * 4]; + + private byte[] Receive() + { + byte[][] packets = null; + byte packetNumber = 0, packetCount = 1; + + do + { + var result = udpClient.Receive( ref endPoint ); + + using ( var br = new BinaryReader( new MemoryStream( result ) ) ) + { + 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 ( 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 combinedData = Combine( packets ); + return combinedData; + } + + private void GetChallengeData() + { + if ( _challengeBytes != null ) return; + + Send( A2S_SERVERQUERY_GETCHALLENGE ); + + var challengeData = Receive(); + + if ( challengeData[0] != 0x41 ) + throw new Exception( "Invalid Challenge" ); + + _challengeBytes = challengeData; + } + + byte[] sendBuffer = new byte[1024]; + + 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 ); + + udpClient.Send( sendBuffer, message.Length + 4 ); + } + + 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; + } + }; + +} From 227aeee9046c10cecff5a7d10831534298a6aff8 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 28 Mar 2018 17:34:36 +0100 Subject: [PATCH 38/40] Apparently Linux needs ThisCall's too now --- Facepunch.Steamworks/Config.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index f2c324e..cb76bb2 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -32,7 +32,7 @@ public static void ForUnity( string platform ) } IsUnity = true; - UseThisCall = SteamNative.Platform.Os == OperatingSystem.Windows; + UseThisCall = SteamNative.Platform.Os == OperatingSystem.Windows || SteamNative.Platform.Os == OperatingSystem.Linux; Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); From ff1d866374ccc2099e4a66092977b9b465f7b69f Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 29 Mar 2018 10:14:53 +0100 Subject: [PATCH 39/40] Mac uses this call's too (waiting before I rip out older methods) --- Facepunch.Steamworks/Config.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index cb76bb2..8bf4f54 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -32,7 +32,7 @@ public static void ForUnity( string platform ) } IsUnity = true; - UseThisCall = SteamNative.Platform.Os == OperatingSystem.Windows || SteamNative.Platform.Os == OperatingSystem.Linux; + UseThisCall = true; Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); From 46f56c24f3998a510d9a16a1c32fd2118004e020 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 3 Apr 2018 09:55:11 +0100 Subject: [PATCH 40/40] In SourceServerQuery, read strings as UTF8 --- .../Client/ServerlistTest.cs | 21 ++++++++++--------- Facepunch.Steamworks/Utility.cs | 4 ++-- .../Utility/SourceServerQuery.cs | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs index 9f5b413..c96c19c 100644 --- a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs +++ b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs @@ -406,9 +406,10 @@ public void Rules() 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(); @@ -416,8 +417,8 @@ public void Rules() GC.Collect(); System.Threading.Thread.Sleep( 10 ); - if ( query.Responded.Count > 20 ) - break; + // if ( query.Responded.Count > 20 ) + // break; if ( query.Finished ) break; @@ -425,15 +426,12 @@ public void Rules() query.Dispose(); - var servers = query.Responded.Take( 10 ); - - foreach ( var server in servers ) - { - server.FetchRules(); - } + var servers = query.Responded.Take( 100 ); foreach ( var server in servers ) { + server.FetchRules(); + int i = 0; while ( !server.HasRules ) { @@ -447,7 +445,10 @@ public void Rules() if ( server.HasRules ) { - Console.WriteLine( "SERVER HAS RULES :D" ); + Console.WriteLine( "" ); + Console.WriteLine( "" ); + Console.WriteLine( server.Address ); + Console.WriteLine( "" ); foreach ( var rule in server.Rules ) { diff --git a/Facepunch.Steamworks/Utility.cs b/Facepunch.Steamworks/Utility.cs index 1b86696..1bb7e43 100644 --- a/Facepunch.Steamworks/Utility.cs +++ b/Facepunch.Steamworks/Utility.cs @@ -79,7 +79,7 @@ internal static string FormatPrice(string currency, ulong price) } } - public static string ReadAnsiString( this BinaryReader br, byte[] buffer = null ) + public static string ReadNullTerminatedUTF8String( this BinaryReader br, byte[] buffer = null ) { if ( buffer == null ) buffer = new byte[1024]; @@ -92,7 +92,7 @@ public static string ReadAnsiString( this BinaryReader br, byte[] buffer = null i++; } - return Encoding.ASCII.GetString( buffer, 0, i ); + return Encoding.UTF8.GetString( buffer, 0, i ); } } diff --git a/Facepunch.Steamworks/Utility/SourceServerQuery.cs b/Facepunch.Steamworks/Utility/SourceServerQuery.cs index e831ac8..fa8c3a5 100644 --- a/Facepunch.Steamworks/Utility/SourceServerQuery.cs +++ b/Facepunch.Steamworks/Utility/SourceServerQuery.cs @@ -100,7 +100,7 @@ void GetRules() var numRules = br.ReadUInt16(); for ( int index = 0; index < numRules; index++ ) { - rules.Add( br.ReadAnsiString( readBuffer ), br.ReadAnsiString( readBuffer ) ); + rules.Add( br.ReadNullTerminatedUTF8String( readBuffer ), br.ReadNullTerminatedUTF8String( readBuffer ) ); } }