diff --git a/Facepunch.Steamworks/Callbacks/CallbackResult.cs b/Facepunch.Steamworks/Callbacks/CallbackResult.cs index 5d1d338..5cfcda3 100644 --- a/Facepunch.Steamworks/Callbacks/CallbackResult.cs +++ b/Facepunch.Steamworks/Callbacks/CallbackResult.cs @@ -1,15 +1,13 @@ using Steamworks.Data; using System; using System.Collections.Generic; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading.Tasks; namespace Steamworks { - // - // Created on registration of a callback - // - internal struct CallbackResult + internal struct CallbackResult : INotifyCompletion where T : struct, ICallbackData { SteamAPICall_t call; @@ -18,19 +16,18 @@ public CallbackResult( SteamAPICall_t call ) this.call = call; } - public async Task GetAsync() where T : struct, ICallbackData + public void OnCompleted( Action continuation ) { - bool failed = false; + throw new NotImplementedException(); + } + + public T? GetResult() + { + if ( !SteamUtils.IsCallComplete( call, out var failed ) || failed ) + return null; + var t = default( T ); var size = t.DataSize; - - while ( !SteamUtils.IsCallComplete( call, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - var ptr = Marshal.AllocHGlobal( size ); try @@ -46,5 +43,20 @@ public CallbackResult( SteamAPICall_t call ) } } + public bool IsCompleted + { + get + { + if ( SteamUtils.IsCallComplete( call, out var failed ) || failed ) + return true; + + return false; + } + } + + internal CallbackResult GetAwaiter() + { + return this; + } } } \ No newline at end of file diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index 278d7a1..b553c16 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -305,10 +305,10 @@ internal void RequestAllProofOfPurchaseKeys() private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); #endregion - internal CallbackResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) + internal CallbackResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) { var returnValue = _GetFileDetails( Self, pszFileName ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index 0188c05..0b08dc7 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -27,10 +27,10 @@ internal string GetPersonaName() private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); #endregion - internal CallbackResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) + internal CallbackResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) { var returnValue = _SetPersonaName( Self, pchPersonaName ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -271,10 +271,10 @@ internal bool GetClanActivityCounts( SteamId steamIDClan, ref int pnOnline, ref private static extern SteamAPICall_t _DownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest ); #endregion - internal CallbackResult DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) + internal CallbackResult DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) { var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -431,10 +431,10 @@ internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( Unmanaged private static extern SteamAPICall_t _RequestClanOfficerList( IntPtr self, SteamId steamIDClan ); #endregion - internal CallbackResult RequestClanOfficerList( SteamId steamIDClan ) + internal CallbackResult RequestClanOfficerList( SteamId steamIDClan ) { var returnValue = _RequestClanOfficerList( Self, steamIDClan ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -607,10 +607,10 @@ internal AppId GetFriendCoplayGame( SteamId steamIDFriend ) private static extern SteamAPICall_t _JoinClanChatRoom( IntPtr self, SteamId steamIDClan ); #endregion - internal CallbackResult JoinClanChatRoom( SteamId steamIDClan ) + internal CallbackResult JoinClanChatRoom( SteamId steamIDClan ) { var returnValue = _JoinClanChatRoom( Self, steamIDClan ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -758,10 +758,10 @@ internal int GetFriendMessage( SteamId steamIDFriend, int iMessageID, IntPtr pvD private static extern SteamAPICall_t _GetFollowerCount( IntPtr self, SteamId steamID ); #endregion - internal CallbackResult GetFollowerCount( SteamId steamID ) + internal CallbackResult GetFollowerCount( SteamId steamID ) { var returnValue = _GetFollowerCount( Self, steamID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -769,10 +769,10 @@ internal CallbackResult GetFollowerCount( SteamId steamID ) private static extern SteamAPICall_t _IsFollowing( IntPtr self, SteamId steamID ); #endregion - internal CallbackResult IsFollowing( SteamId steamID ) + internal CallbackResult IsFollowing( SteamId steamID ) { var returnValue = _IsFollowing( Self, steamID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -780,10 +780,10 @@ internal CallbackResult IsFollowing( SteamId steamID ) private static extern SteamAPICall_t _EnumerateFollowingList( IntPtr self, uint unStartIndex ); #endregion - internal CallbackResult EnumerateFollowingList( uint unStartIndex ) + internal CallbackResult EnumerateFollowingList( uint unStartIndex ) { var returnValue = _EnumerateFollowingList( Self, unStartIndex ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs index f425d2f..fd9f80f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -385,10 +385,10 @@ internal void GetGameplayStats() private static extern SteamAPICall_t _GetServerReputation( IntPtr self ); #endregion - internal CallbackResult GetServerReputation() + internal CallbackResult GetServerReputation() { var returnValue = _GetServerReputation( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -460,10 +460,10 @@ internal void ForceHeartbeat() private static extern SteamAPICall_t _AssociateWithClan( IntPtr self, SteamId steamIDClan ); #endregion - internal CallbackResult AssociateWithClan( SteamId steamIDClan ) + internal CallbackResult AssociateWithClan( SteamId steamIDClan ) { var returnValue = _AssociateWithClan( Self, steamIDClan ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -471,10 +471,10 @@ internal CallbackResult AssociateWithClan( SteamId steamIDClan ) private static extern SteamAPICall_t _ComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); #endregion - internal CallbackResult ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) + internal CallbackResult ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) { var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs index 0a67589..adc57d4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -16,10 +16,10 @@ internal class ISteamGameServerStats : SteamInterface private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal CallbackResult RequestUserStats( SteamId steamIDUser ) + internal CallbackResult RequestUserStats( SteamId steamIDUser ) { var returnValue = _RequestUserStats( Self, steamIDUser ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -123,10 +123,10 @@ internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedTy private static extern SteamAPICall_t _StoreUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal CallbackResult StoreUserStats( SteamId steamIDUser ) + internal CallbackResult StoreUserStats( SteamId steamIDUser ) { var returnValue = _StoreUserStats( Self, steamIDUser ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs index bace70d..2f785e9 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -290,10 +290,10 @@ internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( private static extern SteamAPICall_t _RequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); #endregion - internal CallbackResult RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) + internal CallbackResult RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) { var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -313,10 +313,10 @@ internal bool GetEligiblePromoItemDefinitionIDs( SteamId steamID, [In,Out] Inven private static extern SteamAPICall_t _StartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); #endregion - internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) { var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -324,10 +324,10 @@ internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs private static extern SteamAPICall_t _RequestPrices( IntPtr self ); #endregion - internal CallbackResult RequestPrices() + internal CallbackResult RequestPrices() { var returnValue = _RequestPrices( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs index 7f10927..42d4eaa 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -62,10 +62,10 @@ internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, usho private static extern SteamAPICall_t _RequestLobbyList( IntPtr self ); #endregion - internal CallbackResult RequestLobbyList() + internal CallbackResult RequestLobbyList() { var returnValue = _RequestLobbyList( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -154,10 +154,10 @@ internal SteamId GetLobbyByIndex( int iLobby ) private static extern SteamAPICall_t _CreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); #endregion - internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) + internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) { var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -165,10 +165,10 @@ internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) private static extern SteamAPICall_t _JoinLobby( IntPtr self, SteamId steamIDLobby ); #endregion - internal CallbackResult JoinLobby( SteamId steamIDLobby ) + internal CallbackResult JoinLobby( SteamId steamIDLobby ) { var returnValue = _JoinLobby( Self, steamIDLobby ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs index 0675fd4..4515a56 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -52,10 +52,10 @@ internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamID private static extern SteamAPICall_t _JoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); #endregion - internal CallbackResult JoinParty( PartyBeaconID_t ulBeaconID ) + internal CallbackResult JoinParty( PartyBeaconID_t ulBeaconID ) { var returnValue = _JoinParty( Self, ulBeaconID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -87,10 +87,10 @@ internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocat private static extern SteamAPICall_t _CreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); #endregion - internal CallbackResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) + internal CallbackResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) { var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -118,10 +118,10 @@ internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) private static extern SteamAPICall_t _ChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); #endregion - internal CallbackResult ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) + internal CallbackResult ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) { var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs index bbeb026..03a2150 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -39,10 +39,10 @@ internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); #endregion - internal CallbackResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) + internal CallbackResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) { var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -50,10 +50,10 @@ internal CallbackResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshale private static extern SteamAPICall_t _FileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); #endregion - internal CallbackResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) + internal CallbackResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) { var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -97,10 +97,10 @@ internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType private static extern SteamAPICall_t _FileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion - internal CallbackResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal CallbackResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) { var returnValue = _FileShare( Self, pchFile ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -292,10 +292,10 @@ internal void SetCloudEnabledForApp( [MarshalAs( UnmanagedType.U1 )] bool bEnabl private static extern SteamAPICall_t _UGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority ); #endregion - internal CallbackResult UGCDownload( UGCHandle_t hContent, uint unPriority ) + internal CallbackResult UGCDownload( UGCHandle_t hContent, uint unPriority ) { var returnValue = _UGCDownload( Self, hContent, unPriority ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -360,10 +360,10 @@ internal UGCHandle_t GetCachedUGCHandle( int iCachedContent ) private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); #endregion - internal CallbackResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) + internal CallbackResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) { var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index 7fff137..b8a3112 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -60,10 +60,10 @@ internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId private static extern SteamAPICall_t _SendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); #endregion - internal CallbackResult SendQueryUGCRequest( UGCQueryHandle_t handle ) + internal CallbackResult SendQueryUGCRequest( UGCQueryHandle_t handle ) { var returnValue = _SendQueryUGCRequest( Self, handle ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -405,10 +405,10 @@ internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( Unman private static extern SteamAPICall_t _RequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ); #endregion - internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) + internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) { var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -416,10 +416,10 @@ internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uin private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); #endregion - internal CallbackResult CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) + internal CallbackResult CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) { var returnValue = _CreateItem( Self, nConsumerAppId, eFileType ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -630,10 +630,10 @@ internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index ) private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); #endregion - internal CallbackResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) + internal CallbackResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) { var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -652,10 +652,10 @@ internal ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, ref u private static extern SteamAPICall_t _SetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ); #endregion - internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) + internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) { var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -663,10 +663,10 @@ internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [Mars private static extern SteamAPICall_t _GetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID ) + internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID ) { var returnValue = _GetUserItemVote( Self, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -674,10 +674,10 @@ internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID ) private static extern SteamAPICall_t _AddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + internal CallbackResult AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) { var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -685,10 +685,10 @@ internal CallbackResult AddItemToFavorites( AppId nAppId, PublishedFileId nPubli private static extern SteamAPICall_t _RemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) { var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -696,10 +696,10 @@ internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId n private static extern SteamAPICall_t _SubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID ) + internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID ) { var returnValue = _SubscribeItem( Self, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -707,10 +707,10 @@ internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID ) private static extern SteamAPICall_t _UnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult UnsubscribeItem( PublishedFileId nPublishedFileID ) + internal CallbackResult UnsubscribeItem( PublishedFileId nPublishedFileID ) { var returnValue = _UnsubscribeItem( Self, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -811,10 +811,10 @@ internal void SuspendDownloads( [MarshalAs( UnmanagedType.U1 )] bool bSuspend ) private static extern SteamAPICall_t _StartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); #endregion - internal CallbackResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + internal CallbackResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) { var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -822,10 +822,10 @@ internal CallbackResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecP private static extern SteamAPICall_t _StopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); #endregion - internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) { var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -833,10 +833,10 @@ internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPu private static extern SteamAPICall_t _StopPlaytimeTrackingForAllItems( IntPtr self ); #endregion - internal CallbackResult StopPlaytimeTrackingForAllItems() + internal CallbackResult StopPlaytimeTrackingForAllItems() { var returnValue = _StopPlaytimeTrackingForAllItems( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -844,10 +844,10 @@ internal CallbackResult StopPlaytimeTrackingForAllItems() private static extern SteamAPICall_t _AddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); #endregion - internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) { var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -855,10 +855,10 @@ internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, P private static extern SteamAPICall_t _RemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); #endregion - internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) { var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -866,10 +866,10 @@ internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID private static extern SteamAPICall_t _AddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); #endregion - internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) { var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -877,10 +877,10 @@ internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppI private static extern SteamAPICall_t _RemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); #endregion - internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) { var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -888,10 +888,10 @@ internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, A private static extern SteamAPICall_t _GetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID ) + internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID ) { var returnValue = _GetAppDependencies( Self, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -899,10 +899,10 @@ internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID ) private static extern SteamAPICall_t _DeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal CallbackResult DeleteItem( PublishedFileId nPublishedFileID ) + internal CallbackResult DeleteItem( PublishedFileId nPublishedFileID ) { var returnValue = _DeleteItem( Self, nPublishedFileID ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs index 3f09e24..e497e84 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -234,10 +234,10 @@ internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort private static extern SteamAPICall_t _RequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); #endregion - internal CallbackResult RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) + internal CallbackResult RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) { var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -279,10 +279,10 @@ internal int GetPlayerSteamLevel() private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); #endregion - internal CallbackResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) + internal CallbackResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) { var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -338,10 +338,10 @@ internal bool BIsPhoneRequiringVerification() private static extern SteamAPICall_t _GetMarketEligibility( IntPtr self ); #endregion - internal CallbackResult GetMarketEligibility() + internal CallbackResult GetMarketEligibility() { var returnValue = _GetMarketEligibility( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs index 4d4d8ec..c285b36 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -204,10 +204,10 @@ internal string GetAchievementName( uint iAchievement ) private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal CallbackResult RequestUserStats( SteamId steamIDUser ) + internal CallbackResult RequestUserStats( SteamId steamIDUser ) { var returnValue = _RequestUserStats( Self, steamIDUser ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -275,10 +275,10 @@ internal bool ResetAllStats( [MarshalAs( UnmanagedType.U1 )] bool bAchievementsT private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); #endregion - internal CallbackResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) + internal CallbackResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) { var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -286,10 +286,10 @@ internal CallbackResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.Custo private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); #endregion - internal CallbackResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) + internal CallbackResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) { var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -341,10 +341,10 @@ internal LeaderboardDisplay GetLeaderboardDisplayType( SteamLeaderboard_t hSteam private static extern SteamAPICall_t _DownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); #endregion - internal CallbackResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) + internal CallbackResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) { var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -352,10 +352,10 @@ internal CallbackResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLea private static extern SteamAPICall_t _DownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ); #endregion - internal CallbackResult DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) + internal CallbackResult DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) { var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -375,10 +375,10 @@ internal bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLea private static extern SteamAPICall_t _UploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ); #endregion - internal CallbackResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) + internal CallbackResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) { var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -386,10 +386,10 @@ internal CallbackResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderb private static extern SteamAPICall_t _AttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); #endregion - internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) + internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) { var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -397,10 +397,10 @@ internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboa private static extern SteamAPICall_t _GetNumberOfCurrentPlayers( IntPtr self ); #endregion - internal CallbackResult GetNumberOfCurrentPlayers() + internal CallbackResult GetNumberOfCurrentPlayers() { var returnValue = _GetNumberOfCurrentPlayers( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -408,10 +408,10 @@ internal CallbackResult GetNumberOfCurrentPlayers() private static extern SteamAPICall_t _RequestGlobalAchievementPercentages( IntPtr self ); #endregion - internal CallbackResult RequestGlobalAchievementPercentages() + internal CallbackResult RequestGlobalAchievementPercentages() { var returnValue = _RequestGlobalAchievementPercentages( Self ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta @@ -457,10 +457,10 @@ internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMar private static extern SteamAPICall_t _RequestGlobalStats( IntPtr self, int nHistoryDays ); #endregion - internal CallbackResult RequestGlobalStats( int nHistoryDays ) + internal CallbackResult RequestGlobalStats( int nHistoryDays ) { var returnValue = _RequestGlobalStats( Self, nHistoryDays ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs index ee035d5..723bde3 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -219,10 +219,10 @@ internal bool BOverlayNeedsPresent() private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); #endregion - internal CallbackResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) + internal CallbackResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) { var returnValue = _CheckFileSignature( Self, szFileName ); - return new CallbackResult( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs index fcfffb5..8c0f923 100644 --- a/Facepunch.Steamworks/SteamApps.cs +++ b/Facepunch.Steamworks/SteamApps.cs @@ -240,7 +240,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid ) /// public static async Task GetFileDetailsAsync( string filename ) { - var r = await Internal.GetFileDetails( filename ).GetAsync(); + var r = await Internal.GetFileDetails( filename ); if ( !r.HasValue || r.Value.Result != Result.OK ) return null; diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index 8785d74..c26c09c 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -287,13 +287,13 @@ public static bool ListenForFriendsMessages public static async Task IsFollowing(SteamId steamID) { - var r = await Internal.IsFollowing(steamID).GetAsync(); + var r = await Internal.IsFollowing(steamID); return r.Value.IsFollowing; } public static async Task GetFollowerCount(SteamId steamID) { - var r = await Internal.GetFollowerCount(steamID).GetAsync(); + var r = await Internal.GetFollowerCount(steamID); return r.Value.Count; } @@ -306,7 +306,7 @@ public static async Task GetFollowingList() do { - if ( (result = await Internal.EnumerateFollowingList((uint)resultCount).GetAsync()) != null) + if ( (result = await Internal.EnumerateFollowingList((uint)resultCount)) != null) { resultCount += result.Value.ResultsReturned; diff --git a/Facepunch.Steamworks/SteamServerStats.cs b/Facepunch.Steamworks/SteamServerStats.cs index a6c74a7..10a5f8b 100644 --- a/Facepunch.Steamworks/SteamServerStats.cs +++ b/Facepunch.Steamworks/SteamServerStats.cs @@ -24,7 +24,7 @@ internal override void InitializeInterface() /// public static async Task RequestUserStats( SteamId steamid ) { - var r = await Internal.RequestUserStats( steamid ).GetAsync(); + var r = await Internal.RequestUserStats( steamid ); if ( !r.HasValue ) return Result.Fail; return r.Value.Result; } @@ -115,7 +115,7 @@ public static bool GetAchievement( SteamId steamid, string name ) /// public static async Task StoreUserStats( SteamId steamid ) { - var r = await Internal.StoreUserStats( steamid ).GetAsync(); + var r = await Internal.StoreUserStats( steamid ); if ( !r.HasValue ) return Result.Fail; return r.Value.Result; } diff --git a/Facepunch.Steamworks/Structs/Leaderboard.cs b/Facepunch.Steamworks/Structs/Leaderboard.cs index ca71dd2..2010a33 100644 --- a/Facepunch.Steamworks/Structs/Leaderboard.cs +++ b/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -28,7 +28,7 @@ public struct Leaderboard { if ( details == null ) details = noDetails; - var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ).GetAsync(); + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ); if ( !r.HasValue ) return null; return LeaderboardUpdate.From( r.Value ); @@ -41,7 +41,7 @@ public struct Leaderboard { if ( details == null ) details = noDetails; - var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ).GetAsync(); + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ); if ( !r.HasValue ) return null; return LeaderboardUpdate.From( r.Value ); @@ -52,7 +52,7 @@ public struct Leaderboard /// public async Task AttachUgc( Ugc file ) { - var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ).GetAsync(); + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); if ( !r.HasValue ) return Result.Fail; return r.Value.Result; @@ -65,7 +65,7 @@ public async Task GetScoresAsync( int count, int offset = 1 { if ( offset <= 0 ) throw new System.ArgumentException( "Should be 1+", nameof( offset ) ); - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ).GetAsync(); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ); if ( !r.HasValue ) return null; @@ -80,7 +80,7 @@ public async Task GetScoresAsync( int count, int offset = 1 /// public async Task GetScoresAroundUserAsync( int start = -10, int end = 10 ) { - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ).GetAsync(); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ); if ( !r.HasValue ) return null; @@ -92,7 +92,7 @@ public async Task GetScoresAroundUserAsync( int start = -10, /// public async Task GetScoresFromFriendsAsync() { - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ).GetAsync(); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ); if ( !r.HasValue ) return null; diff --git a/Facepunch.Steamworks/Structs/Stat.cs b/Facepunch.Steamworks/Structs/Stat.cs index 889de0d..3c7bc68 100644 --- a/Facepunch.Steamworks/Structs/Stat.cs +++ b/Facepunch.Steamworks/Structs/Stat.cs @@ -51,7 +51,7 @@ public long GetGlobalInt() public async Task GetGlobalIntDaysAsync( int days ) { - var result = await SteamUserStats.Internal.RequestGlobalStats( days ).GetAsync(); + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); if ( result?.Result != Result.OK ) return null; var r = new long[days]; @@ -66,7 +66,7 @@ public async Task GetGlobalIntDaysAsync( int days ) public async Task GetGlobalFloatDays( int days ) { - var result = await SteamUserStats.Internal.RequestGlobalStats( days ).GetAsync(); + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); if ( result?.Result != Result.OK ) return null; var r = new double[days]; diff --git a/Facepunch.Steamworks/Structs/UgcEditor.cs b/Facepunch.Steamworks/Structs/UgcEditor.cs index b842df8..5ac9cf7 100644 --- a/Facepunch.Steamworks/Structs/UgcEditor.cs +++ b/Facepunch.Steamworks/Structs/UgcEditor.cs @@ -204,7 +204,7 @@ public async Task SubmitAsync( IProgress progress = null ) progress?.Report( 1 ); - var updated = updating.Result; + var updated = updating.GetResult(); if ( !updated.HasValue ) return result; diff --git a/Facepunch.Steamworks/Structs/UgcQuery.cs b/Facepunch.Steamworks/Structs/UgcQuery.cs index e450b1d..d448224 100644 --- a/Facepunch.Steamworks/Structs/UgcQuery.cs +++ b/Facepunch.Steamworks/Structs/UgcQuery.cs @@ -136,7 +136,7 @@ public Query WithFileId( params PublishedFileId[] files ) ApplyConstraints( handle ); - var result = await SteamUGC.Internal.SendQueryUGCRequest( handle ).GetAsync(); + var result = await SteamUGC.Internal.SendQueryUGCRequest( handle ); if ( !result.HasValue ) return null; diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs index 092225e..e10d021 100644 --- a/Generator/CodeWriter/ClassVTable.cs +++ b/Generator/CodeWriter/ClassVTable.cs @@ -48,7 +48,7 @@ public void GenerateVTableClass( string className, string filename ) } private void WriteFunction( SteamApiDefinition.MethodDef func ) { - var returnType = BaseType.Parse( func.ReturnType ); + var returnType = BaseType.Parse( func.ReturnType, null, func.CallResult ); returnType.Func = func.Name; if ( func.Params == null ) diff --git a/Generator/CodeWriter/Types/BaseType.cs b/Generator/CodeWriter/Types/BaseType.cs index f017d1f..3843d57 100644 --- a/Generator/CodeWriter/Types/BaseType.cs +++ b/Generator/CodeWriter/Types/BaseType.cs @@ -15,14 +15,14 @@ internal class BaseType public virtual bool WindowsSpecific => false; - public static BaseType Parse( string type, string varname = null ) + public static BaseType Parse( string type, string varname = null, string callresult = null ) { type = Cleanup.ConvertType( type ); if ( varname == "ppOutMessages" ) return new PointerType { NativeType = "void *", VarName = varname }; if ( type == "SteamAPIWarningMessageHook_t" ) return new PointerType { NativeType = type, VarName = varname }; - if ( type == "SteamAPICall_t" ) return new SteamApiCallType { NativeType = type, VarName = varname }; + if ( type == "SteamAPICall_t" ) return new SteamApiCallType { NativeType = type, VarName = varname, CallResult = callresult }; if ( type == "void" ) return new VoidType { NativeType = type, VarName = varname }; if ( type.Replace( " ", "" ).StartsWith( "constchar*" ) ) return new ConstCharType { NativeType = type, VarName = varname }; @@ -172,8 +172,25 @@ internal class SteamApiCallType : BaseType { public string CallResult; public override string TypeName => "SteamAPICall_t"; - public override string Return( string varname ) => $"return new CallbackResult( {varname} );"; - public override string ReturnType => $"CallbackResult"; + public override string Return( string varname ) + { + if ( !string.IsNullOrEmpty( CallResult ) ) + return $"return new CallbackResult<{CallResult}>( {varname} );"; + + return $"return new CallbackResult( {varname} );"; + + } + + public override string ReturnType + { + get + { + if ( !string.IsNullOrEmpty( CallResult ) ) + return $"CallbackResult<{CallResult}>"; + + return $"CallbackResult"; + } + } } internal class CSteamIdType : BaseType diff --git a/Generator/steam_sdk/steam_api.json b/Generator/steam_sdk/steam_api.json index e4f8ce6..1ad1129 100644 --- a/Generator/steam_sdk/steam_api.json +++ b/Generator/steam_sdk/steam_api.json @@ -3398,7 +3398,7 @@ "classname": "ISteamFriends", "methodname": "DownloadClanActivityCounts", "returntype": "SteamAPICall_t", - "callbackdata": "DownloadClanActivityCountsResult_t", + "callresult": "DownloadClanActivityCountsResult_t", "callbackid": 341, "params": [ @@ -7583,7 +7583,7 @@ } ,{ "classname": "ISteamUGC", - "methodname": "RequestUGCDetails", + "methodname": "RequestUGCDetails", "callresult": "SteamUGCRequestUGCDetailsResult_t", "returntype": "SteamAPICall_t", "params": [ { "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"},