Fixed UGC User Queries

This commit is contained in:
Garry Newman 2019-05-13 09:21:20 +01:00
parent 44dfa45337
commit 326d27e98e
2 changed files with 15 additions and 9 deletions

View File

@ -69,7 +69,7 @@ namespace Steamworks
public async Task QueryUserOwn()
{
var q = Ugc.Query.All
.CreatedByMe();
.WhereUserPublished();
var result = await q.GetPageAsync( 1 );
Assert.IsNotNull( result );
@ -87,7 +87,7 @@ namespace Steamworks
public async Task QueryGarry()
{
var q = Ugc.Query.All
.CreatedBy( 76561197960279927 );
.WhereUserPublished( 76561197960279927 );
var result = await q.GetPageAsync( 1 );
Assert.IsNotNull( result );

View File

@ -63,19 +63,25 @@ namespace Steamworks.Ugc
UserUGCList userType;
UserUGCListSortOrder userSort;
public Query CreatedBy( SteamId steamid )
internal Query LimitUser( SteamId steamid )
{
if ( steamid.Value == 0 )
steamid = SteamClient.SteamId;
this.steamid = steamid;
return this;
}
public Query CreatedByMe()
{
this.steamid = SteamClient.SteamId;
return this;
}
public Query WhereUserPublished( SteamId user = default ) { userType = UserUGCList.Published; LimitUser( user ); return this; }
public Query WhereUserVotedOn( SteamId user = default ) { userType = UserUGCList.VotedOn; LimitUser( user ); return this; }
public Query WhereUserVotedUp( SteamId user = default ) { userType = UserUGCList.VotedUp; LimitUser( user ); return this; }
public Query WhereUserVotedDown( SteamId user = default ) { userType = UserUGCList.VotedDown; LimitUser( user ); return this; }
public Query WhereUserWillVoteLater( SteamId user = default ) { userType = UserUGCList.WillVoteLater; LimitUser( user ); return this; }
public Query WhereUserFavorited( SteamId user = default ) { userType = UserUGCList.Favorited; LimitUser( user ); return this; }
public Query WhereUserSubscribed( SteamId user = default ) { userType = UserUGCList.Subscribed; LimitUser( user ); return this; }
public Query WhereUserUsedOrPlayed( SteamId user = default ) { userType = UserUGCList.UsedOrPlayed; LimitUser( user ); return this; }
public Query WhereUserFollowed( SteamId user = default ) { userType = UserUGCList.Followed; LimitUser( user ); return this; }
public Query WherePublished() { userType = UserUGCList.Published; return this; }
public Query SortByCreationDate() { userSort = UserUGCListSortOrder.CreationOrderDesc; return this; }
public Query SortByCreationDateAsc() { userSort = UserUGCListSortOrder.CreationOrderAsc; return this; }
public Query SortByTitleAsc() { userSort = UserUGCListSortOrder.TitleAsc; return this; }