diff --git a/Facepunch.Steamworks.Test/Client/Workshop.cs b/Facepunch.Steamworks.Test/Client/Workshop.cs index 4bf8a01..6431a01 100644 --- a/Facepunch.Steamworks.Test/Client/Workshop.cs +++ b/Facepunch.Steamworks.Test/Client/Workshop.cs @@ -36,20 +36,22 @@ public void Query() Query.Order = Workshop.Order.RankedByTextSearch; Query.QueryType = Workshop.QueryType.Items_Mtx; - Query.SearchText = "rock"; + Query.SearchText = "shit"; Query.Run(); // Block, wait for result // (don't do this in realtime) 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.Items.Length > 0 ); foreach ( var item in Query.Items ) { Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "{0}\n", item.Description ); } for ( int i=0; i<100; i++ ) diff --git a/Facepunch.Steamworks/Interfaces/Workshop.cs b/Facepunch.Steamworks/Interfaces/Workshop.cs index 71bfee7..1123328 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.cs @@ -64,6 +64,7 @@ public enum QueryType public WorkshopQuery CreateQuery() { var q = new WorkshopQuery(); + q.AppId = steamworks.AppId; q.workshop = this; return q; } @@ -101,6 +102,17 @@ public class WorkshopQuery internal ulong Handle; internal QueryCompleted Callback; + /// + /// The AppId you're querying. This defaults to this appid. + /// + public uint AppId { get; set; } + + /// + /// The AppId of the app used to upload the item. This defaults to 0 + /// which means all/any. + /// + public uint UploaderAppId { get; set; } + public QueryType QueryType { get; set; } = QueryType.Items; public Order Order { get; set; } = Order.RankedByVote; @@ -124,7 +136,7 @@ public void Run() if ( Page <= 0 ) 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 ) ) workshop.ugc.SetSearchText( Handle, SearchText );