mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +03:00
WorkshopQuery.UploaderAppId
This commit is contained in:
parent
28baea049c
commit
e98441f28d
@ -36,20 +36,22 @@ namespace Facepunch.Steamworks.Test
|
|||||||
|
|
||||||
Query.Order = Workshop.Order.RankedByTextSearch;
|
Query.Order = Workshop.Order.RankedByTextSearch;
|
||||||
Query.QueryType = Workshop.QueryType.Items_Mtx;
|
Query.QueryType = Workshop.QueryType.Items_Mtx;
|
||||||
Query.SearchText = "rock";
|
Query.SearchText = "shit";
|
||||||
Query.Run();
|
Query.Run();
|
||||||
|
|
||||||
// Block, wait for result
|
// Block, wait for result
|
||||||
// (don't do this in realtime)
|
// (don't do this in realtime)
|
||||||
Query.Block();
|
Query.Block();
|
||||||
|
|
||||||
|
Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults );
|
||||||
|
Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length );
|
||||||
|
|
||||||
Assert.IsTrue( Query.TotalResults > 0 );
|
Assert.IsTrue( Query.TotalResults > 0 );
|
||||||
Assert.IsTrue( Query.Items.Length > 0 );
|
Assert.IsTrue( Query.Items.Length > 0 );
|
||||||
|
|
||||||
foreach ( var item in Query.Items )
|
foreach ( var item in Query.Items )
|
||||||
{
|
{
|
||||||
Console.WriteLine( "{0}", item.Title );
|
Console.WriteLine( "{0}", item.Title );
|
||||||
Console.WriteLine( "{0}\n", item.Description );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int i=0; i<100; i++ )
|
for ( int i=0; i<100; i++ )
|
||||||
|
@ -64,6 +64,7 @@ namespace Facepunch.Steamworks
|
|||||||
public WorkshopQuery CreateQuery()
|
public WorkshopQuery CreateQuery()
|
||||||
{
|
{
|
||||||
var q = new WorkshopQuery();
|
var q = new WorkshopQuery();
|
||||||
|
q.AppId = steamworks.AppId;
|
||||||
q.workshop = this;
|
q.workshop = this;
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
@ -101,6 +102,17 @@ namespace Facepunch.Steamworks
|
|||||||
internal ulong Handle;
|
internal ulong Handle;
|
||||||
internal QueryCompleted Callback;
|
internal QueryCompleted Callback;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The AppId you're querying. This defaults to this appid.
|
||||||
|
/// </summary>
|
||||||
|
public uint AppId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The AppId of the app used to upload the item. This defaults to 0
|
||||||
|
/// which means all/any.
|
||||||
|
/// </summary>
|
||||||
|
public uint UploaderAppId { get; set; }
|
||||||
|
|
||||||
public QueryType QueryType { get; set; } = QueryType.Items;
|
public QueryType QueryType { get; set; } = QueryType.Items;
|
||||||
public Order Order { get; set; } = Order.RankedByVote;
|
public Order Order { get; set; } = Order.RankedByVote;
|
||||||
|
|
||||||
@ -124,7 +136,7 @@ namespace Facepunch.Steamworks
|
|||||||
if ( Page <= 0 )
|
if ( Page <= 0 )
|
||||||
throw new System.Exception( "Page should be 1 or above" );
|
throw new System.Exception( "Page should be 1 or above" );
|
||||||
|
|
||||||
Handle = workshop.ugc.CreateQueryAllUGCRequest( (uint)Order, (uint)QueryType, workshop.steamworks.AppId, workshop.steamworks.AppId, (uint)Page );
|
Handle = workshop.ugc.CreateQueryAllUGCRequest( (uint)Order, (uint)QueryType, UploaderAppId, AppId,( uint)Page );
|
||||||
|
|
||||||
if ( !string.IsNullOrEmpty( SearchText ) )
|
if ( !string.IsNullOrEmpty( SearchText ) )
|
||||||
workshop.ugc.SetSearchText( Handle, SearchText );
|
workshop.ugc.SetSearchText( Handle, SearchText );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user