callresults

This commit is contained in:
Garry Newman 2020-02-10 21:03:17 +00:00
parent 3bfc441355
commit d28ec6bd7d
23 changed files with 186 additions and 157 deletions

View File

@ -1,15 +1,13 @@
using Steamworks.Data; using Steamworks.Data;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Steamworks namespace Steamworks
{ {
// internal struct CallbackResult<T> : INotifyCompletion where T : struct, ICallbackData
// Created on registration of a callback
//
internal struct CallbackResult
{ {
SteamAPICall_t call; SteamAPICall_t call;
@ -18,19 +16,18 @@ public CallbackResult( SteamAPICall_t call )
this.call = call; this.call = call;
} }
public async Task<T?> GetAsync<T>() 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 t = default( T );
var size = t.DataSize; 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 ); var ptr = Marshal.AllocHGlobal( size );
try 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<T> GetAwaiter()
{
return this;
}
} }
} }

View File

@ -305,10 +305,10 @@ internal void RequestAllProofOfPurchaseKeys()
private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName );
#endregion #endregion
internal CallbackResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) internal CallbackResult<FileDetailsResult_t> GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName )
{ {
var returnValue = _GetFileDetails( Self, pszFileName ); var returnValue = _GetFileDetails( Self, pszFileName );
return new CallbackResult( returnValue ); return new CallbackResult<FileDetailsResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -27,10 +27,10 @@ internal string GetPersonaName()
private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName );
#endregion #endregion
internal CallbackResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) internal CallbackResult<SetPersonaNameResponse_t> SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName )
{ {
var returnValue = _SetPersonaName( Self, pchPersonaName ); var returnValue = _SetPersonaName( Self, pchPersonaName );
return new CallbackResult( returnValue ); return new CallbackResult<SetPersonaNameResponse_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _DownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest );
#endregion #endregion
internal CallbackResult DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) internal CallbackResult<DownloadClanActivityCountsResult_t> DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest )
{ {
var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest ); var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest );
return new CallbackResult( returnValue ); return new CallbackResult<DownloadClanActivityCountsResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -431,10 +431,10 @@ internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( Unmanaged
private static extern SteamAPICall_t _RequestClanOfficerList( IntPtr self, SteamId steamIDClan ); private static extern SteamAPICall_t _RequestClanOfficerList( IntPtr self, SteamId steamIDClan );
#endregion #endregion
internal CallbackResult RequestClanOfficerList( SteamId steamIDClan ) internal CallbackResult<ClanOfficerListResponse_t> RequestClanOfficerList( SteamId steamIDClan )
{ {
var returnValue = _RequestClanOfficerList( Self, steamIDClan ); var returnValue = _RequestClanOfficerList( Self, steamIDClan );
return new CallbackResult( returnValue ); return new CallbackResult<ClanOfficerListResponse_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -607,10 +607,10 @@ internal AppId GetFriendCoplayGame( SteamId steamIDFriend )
private static extern SteamAPICall_t _JoinClanChatRoom( IntPtr self, SteamId steamIDClan ); private static extern SteamAPICall_t _JoinClanChatRoom( IntPtr self, SteamId steamIDClan );
#endregion #endregion
internal CallbackResult JoinClanChatRoom( SteamId steamIDClan ) internal CallbackResult<JoinClanChatRoomCompletionResult_t> JoinClanChatRoom( SteamId steamIDClan )
{ {
var returnValue = _JoinClanChatRoom( Self, steamIDClan ); var returnValue = _JoinClanChatRoom( Self, steamIDClan );
return new CallbackResult( returnValue ); return new CallbackResult<JoinClanChatRoomCompletionResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _GetFollowerCount( IntPtr self, SteamId steamID );
#endregion #endregion
internal CallbackResult GetFollowerCount( SteamId steamID ) internal CallbackResult<FriendsGetFollowerCount_t> GetFollowerCount( SteamId steamID )
{ {
var returnValue = _GetFollowerCount( Self, steamID ); var returnValue = _GetFollowerCount( Self, steamID );
return new CallbackResult( returnValue ); return new CallbackResult<FriendsGetFollowerCount_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -769,10 +769,10 @@ internal CallbackResult GetFollowerCount( SteamId steamID )
private static extern SteamAPICall_t _IsFollowing( IntPtr self, SteamId steamID ); private static extern SteamAPICall_t _IsFollowing( IntPtr self, SteamId steamID );
#endregion #endregion
internal CallbackResult IsFollowing( SteamId steamID ) internal CallbackResult<FriendsIsFollowing_t> IsFollowing( SteamId steamID )
{ {
var returnValue = _IsFollowing( Self, steamID ); var returnValue = _IsFollowing( Self, steamID );
return new CallbackResult( returnValue ); return new CallbackResult<FriendsIsFollowing_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -780,10 +780,10 @@ internal CallbackResult IsFollowing( SteamId steamID )
private static extern SteamAPICall_t _EnumerateFollowingList( IntPtr self, uint unStartIndex ); private static extern SteamAPICall_t _EnumerateFollowingList( IntPtr self, uint unStartIndex );
#endregion #endregion
internal CallbackResult EnumerateFollowingList( uint unStartIndex ) internal CallbackResult<FriendsEnumerateFollowingList_t> EnumerateFollowingList( uint unStartIndex )
{ {
var returnValue = _EnumerateFollowingList( Self, unStartIndex ); var returnValue = _EnumerateFollowingList( Self, unStartIndex );
return new CallbackResult( returnValue ); return new CallbackResult<FriendsEnumerateFollowingList_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -385,10 +385,10 @@ internal void GetGameplayStats()
private static extern SteamAPICall_t _GetServerReputation( IntPtr self ); private static extern SteamAPICall_t _GetServerReputation( IntPtr self );
#endregion #endregion
internal CallbackResult GetServerReputation() internal CallbackResult<GSReputation_t> GetServerReputation()
{ {
var returnValue = _GetServerReputation( Self ); var returnValue = _GetServerReputation( Self );
return new CallbackResult( returnValue ); return new CallbackResult<GSReputation_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -460,10 +460,10 @@ internal void ForceHeartbeat()
private static extern SteamAPICall_t _AssociateWithClan( IntPtr self, SteamId steamIDClan ); private static extern SteamAPICall_t _AssociateWithClan( IntPtr self, SteamId steamIDClan );
#endregion #endregion
internal CallbackResult AssociateWithClan( SteamId steamIDClan ) internal CallbackResult<AssociateWithClanResult_t> AssociateWithClan( SteamId steamIDClan )
{ {
var returnValue = _AssociateWithClan( Self, steamIDClan ); var returnValue = _AssociateWithClan( Self, steamIDClan );
return new CallbackResult( returnValue ); return new CallbackResult<AssociateWithClanResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -471,10 +471,10 @@ internal CallbackResult AssociateWithClan( SteamId steamIDClan )
private static extern SteamAPICall_t _ComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); private static extern SteamAPICall_t _ComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer );
#endregion #endregion
internal CallbackResult ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) internal CallbackResult<ComputeNewPlayerCompatibilityResult_t> ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer )
{ {
var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer ); var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer );
return new CallbackResult( returnValue ); return new CallbackResult<ComputeNewPlayerCompatibilityResult_t>( returnValue );
} }
} }

View File

@ -16,10 +16,10 @@ internal class ISteamGameServerStats : SteamInterface
private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser );
#endregion #endregion
internal CallbackResult RequestUserStats( SteamId steamIDUser ) internal CallbackResult<GSStatsReceived_t> RequestUserStats( SteamId steamIDUser )
{ {
var returnValue = _RequestUserStats( Self, steamIDUser ); var returnValue = _RequestUserStats( Self, steamIDUser );
return new CallbackResult( returnValue ); return new CallbackResult<GSStatsReceived_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -123,10 +123,10 @@ internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedTy
private static extern SteamAPICall_t _StoreUserStats( IntPtr self, SteamId steamIDUser ); private static extern SteamAPICall_t _StoreUserStats( IntPtr self, SteamId steamIDUser );
#endregion #endregion
internal CallbackResult StoreUserStats( SteamId steamIDUser ) internal CallbackResult<GSStatsStored_t> StoreUserStats( SteamId steamIDUser )
{ {
var returnValue = _StoreUserStats( Self, steamIDUser ); var returnValue = _StoreUserStats( Self, steamIDUser );
return new CallbackResult( returnValue ); return new CallbackResult<GSStatsStored_t>( returnValue );
} }
} }

View File

@ -290,10 +290,10 @@ internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs(
private static extern SteamAPICall_t _RequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); private static extern SteamAPICall_t _RequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID );
#endregion #endregion
internal CallbackResult RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) internal CallbackResult<SteamInventoryEligiblePromoItemDefIDs_t> RequestEligiblePromoItemDefinitionsIDs( SteamId steamID )
{ {
var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID ); var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID );
return new CallbackResult( returnValue ); return new CallbackResult<SteamInventoryEligiblePromoItemDefIDs_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _StartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength );
#endregion #endregion
internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) internal CallbackResult<SteamInventoryStartPurchaseResult_t> StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength )
{ {
var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength ); var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength );
return new CallbackResult( returnValue ); return new CallbackResult<SteamInventoryStartPurchaseResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -324,10 +324,10 @@ internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs
private static extern SteamAPICall_t _RequestPrices( IntPtr self ); private static extern SteamAPICall_t _RequestPrices( IntPtr self );
#endregion #endregion
internal CallbackResult RequestPrices() internal CallbackResult<SteamInventoryRequestPricesResult_t> RequestPrices()
{ {
var returnValue = _RequestPrices( Self ); var returnValue = _RequestPrices( Self );
return new CallbackResult( returnValue ); return new CallbackResult<SteamInventoryRequestPricesResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -62,10 +62,10 @@ internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, usho
private static extern SteamAPICall_t _RequestLobbyList( IntPtr self ); private static extern SteamAPICall_t _RequestLobbyList( IntPtr self );
#endregion #endregion
internal CallbackResult RequestLobbyList() internal CallbackResult<LobbyMatchList_t> RequestLobbyList()
{ {
var returnValue = _RequestLobbyList( Self ); var returnValue = _RequestLobbyList( Self );
return new CallbackResult( returnValue ); return new CallbackResult<LobbyMatchList_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -154,10 +154,10 @@ internal SteamId GetLobbyByIndex( int iLobby )
private static extern SteamAPICall_t _CreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); private static extern SteamAPICall_t _CreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers );
#endregion #endregion
internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) internal CallbackResult<LobbyCreated_t> CreateLobby( LobbyType eLobbyType, int cMaxMembers )
{ {
var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers ); var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers );
return new CallbackResult( returnValue ); return new CallbackResult<LobbyCreated_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -165,10 +165,10 @@ internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers )
private static extern SteamAPICall_t _JoinLobby( IntPtr self, SteamId steamIDLobby ); private static extern SteamAPICall_t _JoinLobby( IntPtr self, SteamId steamIDLobby );
#endregion #endregion
internal CallbackResult JoinLobby( SteamId steamIDLobby ) internal CallbackResult<LobbyEnter_t> JoinLobby( SteamId steamIDLobby )
{ {
var returnValue = _JoinLobby( Self, steamIDLobby ); var returnValue = _JoinLobby( Self, steamIDLobby );
return new CallbackResult( returnValue ); return new CallbackResult<LobbyEnter_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -52,10 +52,10 @@ internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamID
private static extern SteamAPICall_t _JoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); private static extern SteamAPICall_t _JoinParty( IntPtr self, PartyBeaconID_t ulBeaconID );
#endregion #endregion
internal CallbackResult JoinParty( PartyBeaconID_t ulBeaconID ) internal CallbackResult<JoinPartyCallback_t> JoinParty( PartyBeaconID_t ulBeaconID )
{ {
var returnValue = _JoinParty( Self, ulBeaconID ); var returnValue = _JoinParty( Self, ulBeaconID );
return new CallbackResult( returnValue ); return new CallbackResult<JoinPartyCallback_t>( returnValue );
} }
#region FunctionMeta #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 ); 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 #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<CreateBeaconCallback_t> 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 ); var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata );
return new CallbackResult( returnValue ); return new CallbackResult<CreateBeaconCallback_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _ChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots );
#endregion #endregion
internal CallbackResult ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) internal CallbackResult<ChangeNumOpenSlotsCallback_t> ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots )
{ {
var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ); var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots );
return new CallbackResult( returnValue ); return new CallbackResult<ChangeNumOpenSlotsCallback_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -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 ); private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData );
#endregion #endregion
internal CallbackResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) internal CallbackResult<RemoteStorageFileWriteAsyncComplete_t> FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData )
{ {
var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageFileWriteAsyncComplete_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _FileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead );
#endregion #endregion
internal CallbackResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) internal CallbackResult<RemoteStorageFileReadAsyncComplete_t> FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead )
{ {
var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageFileReadAsyncComplete_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _FileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile );
#endregion #endregion
internal CallbackResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) internal CallbackResult<RemoteStorageFileShareResult_t> FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile )
{ {
var returnValue = _FileShare( Self, pchFile ); var returnValue = _FileShare( Self, pchFile );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageFileShareResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _UGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority );
#endregion #endregion
internal CallbackResult UGCDownload( UGCHandle_t hContent, uint unPriority ) internal CallbackResult<RemoteStorageDownloadUGCResult_t> UGCDownload( UGCHandle_t hContent, uint unPriority )
{ {
var returnValue = _UGCDownload( Self, hContent, unPriority ); var returnValue = _UGCDownload( Self, hContent, unPriority );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageDownloadUGCResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority );
#endregion #endregion
internal CallbackResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) internal CallbackResult<RemoteStorageDownloadUGCResult_t> UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority )
{ {
var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageDownloadUGCResult_t>( returnValue );
} }
} }

View File

@ -60,10 +60,10 @@ internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId
private static extern SteamAPICall_t _SendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); private static extern SteamAPICall_t _SendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle );
#endregion #endregion
internal CallbackResult SendQueryUGCRequest( UGCQueryHandle_t handle ) internal CallbackResult<SteamUGCQueryCompleted_t> SendQueryUGCRequest( UGCQueryHandle_t handle )
{ {
var returnValue = _SendQueryUGCRequest( Self, handle ); var returnValue = _SendQueryUGCRequest( Self, handle );
return new CallbackResult( returnValue ); return new CallbackResult<SteamUGCQueryCompleted_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _RequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds );
#endregion #endregion
internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) internal CallbackResult<SteamUGCRequestUGCDetailsResult_t> RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds )
{ {
var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds ); var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds );
return new CallbackResult( returnValue ); return new CallbackResult<SteamUGCRequestUGCDetailsResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -416,10 +416,10 @@ internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uin
private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType );
#endregion #endregion
internal CallbackResult CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) internal CallbackResult<CreateItemResult_t> CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType )
{ {
var returnValue = _CreateItem( Self, nConsumerAppId, eFileType ); var returnValue = _CreateItem( Self, nConsumerAppId, eFileType );
return new CallbackResult( returnValue ); return new CallbackResult<CreateItemResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote );
#endregion #endregion
internal CallbackResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) internal CallbackResult<SubmitItemUpdateResult_t> SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote )
{ {
var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote );
return new CallbackResult( returnValue ); return new CallbackResult<SubmitItemUpdateResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _SetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp );
#endregion #endregion
internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) internal CallbackResult<SetUserItemVoteResult_t> SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp )
{ {
var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp ); var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp );
return new CallbackResult( returnValue ); return new CallbackResult<SetUserItemVoteResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -663,10 +663,10 @@ internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [Mars
private static extern SteamAPICall_t _GetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _GetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID ) internal CallbackResult<GetUserItemVoteResult_t> GetUserItemVote( PublishedFileId nPublishedFileID )
{ {
var returnValue = _GetUserItemVote( Self, nPublishedFileID ); var returnValue = _GetUserItemVote( Self, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<GetUserItemVoteResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -674,10 +674,10 @@ internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID )
private static extern SteamAPICall_t _AddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _AddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) internal CallbackResult<UserFavoriteItemsListChanged_t> AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID )
{ {
var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID ); var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<UserFavoriteItemsListChanged_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _RemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) internal CallbackResult<UserFavoriteItemsListChanged_t> RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID )
{ {
var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID ); var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<UserFavoriteItemsListChanged_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -696,10 +696,10 @@ internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId n
private static extern SteamAPICall_t _SubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _SubscribeItem( IntPtr self, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID ) internal CallbackResult<RemoteStorageSubscribePublishedFileResult_t> SubscribeItem( PublishedFileId nPublishedFileID )
{ {
var returnValue = _SubscribeItem( Self, nPublishedFileID ); var returnValue = _SubscribeItem( Self, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageSubscribePublishedFileResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -707,10 +707,10 @@ internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID )
private static extern SteamAPICall_t _UnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _UnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult UnsubscribeItem( PublishedFileId nPublishedFileID ) internal CallbackResult<RemoteStorageUnsubscribePublishedFileResult_t> UnsubscribeItem( PublishedFileId nPublishedFileID )
{ {
var returnValue = _UnsubscribeItem( Self, nPublishedFileID ); var returnValue = _UnsubscribeItem( Self, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<RemoteStorageUnsubscribePublishedFileResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _StartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs );
#endregion #endregion
internal CallbackResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) internal CallbackResult<StartPlaytimeTrackingResult_t> StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs )
{ {
var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs );
return new CallbackResult( returnValue ); return new CallbackResult<StartPlaytimeTrackingResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _StopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs );
#endregion #endregion
internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) internal CallbackResult<StopPlaytimeTrackingResult_t> StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs )
{ {
var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs );
return new CallbackResult( returnValue ); return new CallbackResult<StopPlaytimeTrackingResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -833,10 +833,10 @@ internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPu
private static extern SteamAPICall_t _StopPlaytimeTrackingForAllItems( IntPtr self ); private static extern SteamAPICall_t _StopPlaytimeTrackingForAllItems( IntPtr self );
#endregion #endregion
internal CallbackResult StopPlaytimeTrackingForAllItems() internal CallbackResult<StopPlaytimeTrackingResult_t> StopPlaytimeTrackingForAllItems()
{ {
var returnValue = _StopPlaytimeTrackingForAllItems( Self ); var returnValue = _StopPlaytimeTrackingForAllItems( Self );
return new CallbackResult( returnValue ); return new CallbackResult<StopPlaytimeTrackingResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -844,10 +844,10 @@ internal CallbackResult StopPlaytimeTrackingForAllItems()
private static extern SteamAPICall_t _AddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); private static extern SteamAPICall_t _AddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID );
#endregion #endregion
internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) internal CallbackResult<AddUGCDependencyResult_t> AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID )
{ {
var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<AddUGCDependencyResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -855,10 +855,10 @@ internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, P
private static extern SteamAPICall_t _RemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); private static extern SteamAPICall_t _RemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID );
#endregion #endregion
internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) internal CallbackResult<RemoveUGCDependencyResult_t> RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID )
{ {
var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<RemoveUGCDependencyResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -866,10 +866,10 @@ internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID
private static extern SteamAPICall_t _AddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); private static extern SteamAPICall_t _AddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID );
#endregion #endregion
internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) internal CallbackResult<AddAppDependencyResult_t> AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID )
{ {
var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID ); var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID );
return new CallbackResult( returnValue ); return new CallbackResult<AddAppDependencyResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -877,10 +877,10 @@ internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppI
private static extern SteamAPICall_t _RemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); private static extern SteamAPICall_t _RemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID );
#endregion #endregion
internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) internal CallbackResult<RemoveAppDependencyResult_t> RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID )
{ {
var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID ); var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID );
return new CallbackResult( returnValue ); return new CallbackResult<RemoveAppDependencyResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -888,10 +888,10 @@ internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, A
private static extern SteamAPICall_t _GetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _GetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID ) internal CallbackResult<GetAppDependenciesResult_t> GetAppDependencies( PublishedFileId nPublishedFileID )
{ {
var returnValue = _GetAppDependencies( Self, nPublishedFileID ); var returnValue = _GetAppDependencies( Self, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<GetAppDependenciesResult_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -899,10 +899,10 @@ internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID )
private static extern SteamAPICall_t _DeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); private static extern SteamAPICall_t _DeleteItem( IntPtr self, PublishedFileId nPublishedFileID );
#endregion #endregion
internal CallbackResult DeleteItem( PublishedFileId nPublishedFileID ) internal CallbackResult<DeleteItemResult_t> DeleteItem( PublishedFileId nPublishedFileID )
{ {
var returnValue = _DeleteItem( Self, nPublishedFileID ); var returnValue = _DeleteItem( Self, nPublishedFileID );
return new CallbackResult( returnValue ); return new CallbackResult<DeleteItemResult_t>( returnValue );
} }
} }

View File

@ -234,10 +234,10 @@ internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort
private static extern SteamAPICall_t _RequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); private static extern SteamAPICall_t _RequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude );
#endregion #endregion
internal CallbackResult RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) internal CallbackResult<EncryptedAppTicketResponse_t> RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude )
{ {
var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude ); var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude );
return new CallbackResult( returnValue ); return new CallbackResult<EncryptedAppTicketResponse_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL );
#endregion #endregion
internal CallbackResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) internal CallbackResult<StoreAuthURLResponse_t> RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL )
{ {
var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL );
return new CallbackResult( returnValue ); return new CallbackResult<StoreAuthURLResponse_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -338,10 +338,10 @@ internal bool BIsPhoneRequiringVerification()
private static extern SteamAPICall_t _GetMarketEligibility( IntPtr self ); private static extern SteamAPICall_t _GetMarketEligibility( IntPtr self );
#endregion #endregion
internal CallbackResult GetMarketEligibility() internal CallbackResult<MarketEligibilityResponse_t> GetMarketEligibility()
{ {
var returnValue = _GetMarketEligibility( Self ); var returnValue = _GetMarketEligibility( Self );
return new CallbackResult( returnValue ); return new CallbackResult<MarketEligibilityResponse_t>( returnValue );
} }
} }

View File

@ -204,10 +204,10 @@ internal string GetAchievementName( uint iAchievement )
private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser );
#endregion #endregion
internal CallbackResult RequestUserStats( SteamId steamIDUser ) internal CallbackResult<UserStatsReceived_t> RequestUserStats( SteamId steamIDUser )
{ {
var returnValue = _RequestUserStats( Self, steamIDUser ); var returnValue = _RequestUserStats( Self, steamIDUser );
return new CallbackResult( returnValue ); return new CallbackResult<UserStatsReceived_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType );
#endregion #endregion
internal CallbackResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) internal CallbackResult<LeaderboardFindResult_t> FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType )
{ {
var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardFindResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName );
#endregion #endregion
internal CallbackResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) internal CallbackResult<LeaderboardFindResult_t> FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName )
{ {
var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); var returnValue = _FindLeaderboard( Self, pchLeaderboardName );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardFindResult_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _DownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd );
#endregion #endregion
internal CallbackResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) internal CallbackResult<LeaderboardScoresDownloaded_t> DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd )
{ {
var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardScoresDownloaded_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _DownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers );
#endregion #endregion
internal CallbackResult DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) internal CallbackResult<LeaderboardScoresDownloaded_t> DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers )
{ {
var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ); var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardScoresDownloaded_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _UploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount );
#endregion #endregion
internal CallbackResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) internal CallbackResult<LeaderboardScoreUploaded_t> UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount )
{ {
var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardScoreUploaded_t>( returnValue );
} }
#region FunctionMeta #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 ); private static extern SteamAPICall_t _AttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC );
#endregion #endregion
internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) internal CallbackResult<LeaderboardUGCSet_t> AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC )
{ {
var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC ); var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC );
return new CallbackResult( returnValue ); return new CallbackResult<LeaderboardUGCSet_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -397,10 +397,10 @@ internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboa
private static extern SteamAPICall_t _GetNumberOfCurrentPlayers( IntPtr self ); private static extern SteamAPICall_t _GetNumberOfCurrentPlayers( IntPtr self );
#endregion #endregion
internal CallbackResult GetNumberOfCurrentPlayers() internal CallbackResult<NumberOfCurrentPlayers_t> GetNumberOfCurrentPlayers()
{ {
var returnValue = _GetNumberOfCurrentPlayers( Self ); var returnValue = _GetNumberOfCurrentPlayers( Self );
return new CallbackResult( returnValue ); return new CallbackResult<NumberOfCurrentPlayers_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -408,10 +408,10 @@ internal CallbackResult GetNumberOfCurrentPlayers()
private static extern SteamAPICall_t _RequestGlobalAchievementPercentages( IntPtr self ); private static extern SteamAPICall_t _RequestGlobalAchievementPercentages( IntPtr self );
#endregion #endregion
internal CallbackResult RequestGlobalAchievementPercentages() internal CallbackResult<GlobalAchievementPercentagesReady_t> RequestGlobalAchievementPercentages()
{ {
var returnValue = _RequestGlobalAchievementPercentages( Self ); var returnValue = _RequestGlobalAchievementPercentages( Self );
return new CallbackResult( returnValue ); return new CallbackResult<GlobalAchievementPercentagesReady_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta
@ -457,10 +457,10 @@ internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMar
private static extern SteamAPICall_t _RequestGlobalStats( IntPtr self, int nHistoryDays ); private static extern SteamAPICall_t _RequestGlobalStats( IntPtr self, int nHistoryDays );
#endregion #endregion
internal CallbackResult RequestGlobalStats( int nHistoryDays ) internal CallbackResult<GlobalStatsReceived_t> RequestGlobalStats( int nHistoryDays )
{ {
var returnValue = _RequestGlobalStats( Self, nHistoryDays ); var returnValue = _RequestGlobalStats( Self, nHistoryDays );
return new CallbackResult( returnValue ); return new CallbackResult<GlobalStatsReceived_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -219,10 +219,10 @@ internal bool BOverlayNeedsPresent()
private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName );
#endregion #endregion
internal CallbackResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) internal CallbackResult<CheckFileSignature_t> CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName )
{ {
var returnValue = _CheckFileSignature( Self, szFileName ); var returnValue = _CheckFileSignature( Self, szFileName );
return new CallbackResult( returnValue ); return new CallbackResult<CheckFileSignature_t>( returnValue );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -240,7 +240,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid )
/// </summary> /// </summary>
public static async Task<FileDetails?> GetFileDetailsAsync( string filename ) public static async Task<FileDetails?> GetFileDetailsAsync( string filename )
{ {
var r = await Internal.GetFileDetails( filename ).GetAsync<FileDetailsResult_t>(); var r = await Internal.GetFileDetails( filename );
if ( !r.HasValue || r.Value.Result != Result.OK ) if ( !r.HasValue || r.Value.Result != Result.OK )
return null; return null;

View File

@ -287,13 +287,13 @@ public static bool ListenForFriendsMessages
public static async Task<bool> IsFollowing(SteamId steamID) public static async Task<bool> IsFollowing(SteamId steamID)
{ {
var r = await Internal.IsFollowing(steamID).GetAsync<FriendsIsFollowing_t>(); var r = await Internal.IsFollowing(steamID);
return r.Value.IsFollowing; return r.Value.IsFollowing;
} }
public static async Task<int> GetFollowerCount(SteamId steamID) public static async Task<int> GetFollowerCount(SteamId steamID)
{ {
var r = await Internal.GetFollowerCount(steamID).GetAsync<FriendsGetFollowerCount_t>(); var r = await Internal.GetFollowerCount(steamID);
return r.Value.Count; return r.Value.Count;
} }
@ -306,7 +306,7 @@ public static async Task<SteamId[]> GetFollowingList()
do do
{ {
if ( (result = await Internal.EnumerateFollowingList((uint)resultCount).GetAsync<FriendsEnumerateFollowingList_t>()) != null) if ( (result = await Internal.EnumerateFollowingList((uint)resultCount)) != null)
{ {
resultCount += result.Value.ResultsReturned; resultCount += result.Value.ResultsReturned;

View File

@ -24,7 +24,7 @@ internal override void InitializeInterface()
/// </summary> /// </summary>
public static async Task<Result> RequestUserStats( SteamId steamid ) public static async Task<Result> RequestUserStats( SteamId steamid )
{ {
var r = await Internal.RequestUserStats( steamid ).GetAsync<UserStatsReceived_t>(); var r = await Internal.RequestUserStats( steamid );
if ( !r.HasValue ) return Result.Fail; if ( !r.HasValue ) return Result.Fail;
return r.Value.Result; return r.Value.Result;
} }
@ -115,7 +115,7 @@ public static bool GetAchievement( SteamId steamid, string name )
/// </summary> /// </summary>
public static async Task<Result> StoreUserStats( SteamId steamid ) public static async Task<Result> StoreUserStats( SteamId steamid )
{ {
var r = await Internal.StoreUserStats( steamid ).GetAsync<UserStatsStored_t>(); var r = await Internal.StoreUserStats( steamid );
if ( !r.HasValue ) return Result.Fail; if ( !r.HasValue ) return Result.Fail;
return r.Value.Result; return r.Value.Result;
} }

View File

@ -28,7 +28,7 @@ public struct Leaderboard
{ {
if ( details == null ) details = noDetails; if ( details == null ) details = noDetails;
var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ).GetAsync<LeaderboardScoreUploaded_t>(); var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length );
if ( !r.HasValue ) return null; if ( !r.HasValue ) return null;
return LeaderboardUpdate.From( r.Value ); return LeaderboardUpdate.From( r.Value );
@ -41,7 +41,7 @@ public struct Leaderboard
{ {
if ( details == null ) details = noDetails; if ( details == null ) details = noDetails;
var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ).GetAsync<LeaderboardScoreUploaded_t>(); var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length );
if ( !r.HasValue ) return null; if ( !r.HasValue ) return null;
return LeaderboardUpdate.From( r.Value ); return LeaderboardUpdate.From( r.Value );
@ -52,7 +52,7 @@ public struct Leaderboard
/// </summary> /// </summary>
public async Task<Result> AttachUgc( Ugc file ) public async Task<Result> AttachUgc( Ugc file )
{ {
var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ).GetAsync<LeaderboardUGCSet_t>(); var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle );
if ( !r.HasValue ) return Result.Fail; if ( !r.HasValue ) return Result.Fail;
return r.Value.Result; return r.Value.Result;
@ -65,7 +65,7 @@ public async Task<LeaderboardEntry[]> GetScoresAsync( int count, int offset = 1
{ {
if ( offset <= 0 ) throw new System.ArgumentException( "Should be 1+", nameof( offset ) ); 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<LeaderboardScoresDownloaded_t>(); var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count );
if ( !r.HasValue ) if ( !r.HasValue )
return null; return null;
@ -80,7 +80,7 @@ public async Task<LeaderboardEntry[]> GetScoresAsync( int count, int offset = 1
/// </summary> /// </summary>
public async Task<LeaderboardEntry[]> GetScoresAroundUserAsync( int start = -10, int end = 10 ) public async Task<LeaderboardEntry[]> GetScoresAroundUserAsync( int start = -10, int end = 10 )
{ {
var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ).GetAsync<LeaderboardScoresDownloaded_t>(); var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end );
if ( !r.HasValue ) if ( !r.HasValue )
return null; return null;
@ -92,7 +92,7 @@ public async Task<LeaderboardEntry[]> GetScoresAroundUserAsync( int start = -10,
/// </summary> /// </summary>
public async Task<LeaderboardEntry[]> GetScoresFromFriendsAsync() public async Task<LeaderboardEntry[]> GetScoresFromFriendsAsync()
{ {
var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ).GetAsync<LeaderboardScoresDownloaded_t>(); var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 );
if ( !r.HasValue ) if ( !r.HasValue )
return null; return null;

View File

@ -51,7 +51,7 @@ public long GetGlobalInt()
public async Task<long[]> GetGlobalIntDaysAsync( int days ) public async Task<long[]> GetGlobalIntDaysAsync( int days )
{ {
var result = await SteamUserStats.Internal.RequestGlobalStats( days ).GetAsync<GlobalStatsReceived_t>(); var result = await SteamUserStats.Internal.RequestGlobalStats( days );
if ( result?.Result != Result.OK ) return null; if ( result?.Result != Result.OK ) return null;
var r = new long[days]; var r = new long[days];
@ -66,7 +66,7 @@ public async Task<long[]> GetGlobalIntDaysAsync( int days )
public async Task<double[]> GetGlobalFloatDays( int days ) public async Task<double[]> GetGlobalFloatDays( int days )
{ {
var result = await SteamUserStats.Internal.RequestGlobalStats( days ).GetAsync<GlobalStatsReceived_t>(); var result = await SteamUserStats.Internal.RequestGlobalStats( days );
if ( result?.Result != Result.OK ) return null; if ( result?.Result != Result.OK ) return null;
var r = new double[days]; var r = new double[days];

View File

@ -204,7 +204,7 @@ public async Task<PublishResult> SubmitAsync( IProgress<float> progress = null )
progress?.Report( 1 ); progress?.Report( 1 );
var updated = updating.Result; var updated = updating.GetResult();
if ( !updated.HasValue ) return result; if ( !updated.HasValue ) return result;

View File

@ -136,7 +136,7 @@ public Query WithFileId( params PublishedFileId[] files )
ApplyConstraints( handle ); ApplyConstraints( handle );
var result = await SteamUGC.Internal.SendQueryUGCRequest( handle ).GetAsync<SteamUGCQueryCompleted_t>(); var result = await SteamUGC.Internal.SendQueryUGCRequest( handle );
if ( !result.HasValue ) if ( !result.HasValue )
return null; return null;

View File

@ -48,7 +48,7 @@ public void GenerateVTableClass( string className, string filename )
} }
private void WriteFunction( SteamApiDefinition.MethodDef func ) 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; returnType.Func = func.Name;
if ( func.Params == null ) if ( func.Params == null )

View File

@ -15,14 +15,14 @@ internal class BaseType
public virtual bool WindowsSpecific => false; 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 ); type = Cleanup.ConvertType( type );
if ( varname == "ppOutMessages" ) return new PointerType { NativeType = "void *", VarName = varname }; if ( varname == "ppOutMessages" ) return new PointerType { NativeType = "void *", VarName = varname };
if ( type == "SteamAPIWarningMessageHook_t" ) return new PointerType { NativeType = type, 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 == "void" ) return new VoidType { NativeType = type, VarName = varname };
if ( type.Replace( " ", "" ).StartsWith( "constchar*" ) ) return new ConstCharType { 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 string CallResult;
public override string TypeName => "SteamAPICall_t"; public override string TypeName => "SteamAPICall_t";
public override string Return( string varname ) => $"return new CallbackResult( {varname} );"; public override string Return( string varname )
public override string ReturnType => $"CallbackResult"; {
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 internal class CSteamIdType : BaseType

View File

@ -3398,7 +3398,7 @@
"classname": "ISteamFriends", "classname": "ISteamFriends",
"methodname": "DownloadClanActivityCounts", "methodname": "DownloadClanActivityCounts",
"returntype": "SteamAPICall_t", "returntype": "SteamAPICall_t",
"callbackdata": "DownloadClanActivityCountsResult_t", "callresult": "DownloadClanActivityCountsResult_t",
"callbackid": 341, "callbackid": 341,
"params": "params":
[ [
@ -7583,7 +7583,7 @@
} }
,{ ,{
"classname": "ISteamUGC", "classname": "ISteamUGC",
"methodname": "RequestUGCDetails", "methodname": "RequestUGCDetails", "callresult": "SteamUGCRequestUGCDetailsResult_t",
"returntype": "SteamAPICall_t", "returntype": "SteamAPICall_t",
"params": [ "params": [
{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, { "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"},