Use SteamNative.UGCQueryHandle_t internally

This commit is contained in:
Garry Newman 2016-10-26 14:51:24 +01:00
parent b549bdcec8
commit 7b19866d1b

View File

@ -11,7 +11,7 @@ namespace Facepunch.Steamworks
{ {
internal const int SteamResponseSize = 50; internal const int SteamResponseSize = 50;
internal ulong Handle; internal SteamNative.UGCQueryHandle_t Handle;
internal QueryCompleted Callback; internal QueryCompleted Callback;
/// <summary> /// <summary>
@ -88,13 +88,15 @@ namespace Facepunch.Steamworks
else if ( UserId.HasValue ) else if ( UserId.HasValue )
{ {
uint accountId = (uint)( UserId.Value & 0xFFFFFFFFul ); uint accountId = (uint)( UserId.Value & 0xFFFFFFFFul );
Handle = workshop.ugc.CreateQueryUserUGCRequest( accountId, (SteamNative.UserUGCList)( uint)UserQueryType, (SteamNative.UGCMatchingUGCType)( uint)QueryType, SteamNative.UserUGCListSortOrder.LastUpdatedDesc, UploaderAppId, AppId, (uint)_resultPage + 1 ); Handle = workshop.ugc.CreateQueryUserUGCRequest( accountId, (SteamNative.UserUGCList)( int)UserQueryType, (SteamNative.UGCMatchingUGCType)( int)QueryType, SteamNative.UserUGCListSortOrder.LastUpdatedDesc, UploaderAppId, AppId, (uint)_resultPage + 1 );
} }
else else
{ {
Handle = workshop.ugc.CreateQueryAllUGCRequest( (SteamNative.UGCQuery)(uint)Order, (SteamNative.UGCMatchingUGCType)(uint)QueryType, UploaderAppId, AppId, (uint)_resultPage + 1 ); Handle = workshop.ugc.CreateQueryAllUGCRequest( (SteamNative.UGCQuery)(int)Order, (SteamNative.UGCMatchingUGCType)(int)QueryType, UploaderAppId, AppId, (uint)_resultPage + 1 );
} }
Console.WriteLine( "Handle: " + Handle.Value );
if ( !string.IsNullOrEmpty( SearchText ) ) if ( !string.IsNullOrEmpty( SearchText ) )
workshop.ugc.SetSearchText( Handle, SearchText ); workshop.ugc.SetSearchText( Handle, SearchText );
@ -110,6 +112,9 @@ namespace Facepunch.Steamworks
Callback = new QueryCompleted(); Callback = new QueryCompleted();
Callback.Handle = workshop.ugc.SendQueryUGCRequest( Handle ); Callback.Handle = workshop.ugc.SendQueryUGCRequest( Handle );
Callback.OnResult = OnResult; Callback.OnResult = OnResult;
Console.WriteLine( "Callback.Handle: " + Callback.Handle.Value );
workshop.steamworks.AddCallResult( Callback ); workshop.steamworks.AddCallResult( Callback );
} }