quests: ReportProgressAsync + generated DTOs
This commit is contained in:
@@ -34,4 +34,16 @@ public sealed class QuestsService
|
||||
"/sdk/v1/quests/claim",
|
||||
new ClaimQuestRequest { QuestId = questId },
|
||||
cancellationToken);
|
||||
|
||||
/// <summary>Reports progress for a metric and returns the ids of quests completed by this report.</summary>
|
||||
public async Task<IReadOnlyList<string>> ReportProgressAsync(string metric, long amount, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var response = await _client.SendAsync<ReportQuestProgressRequest, ReportQuestProgressResponse>(
|
||||
"POST",
|
||||
"/sdk/v1/quests/progress",
|
||||
new ReportQuestProgressRequest { Metric = metric, Amount = amount },
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return response?.CompletedQuestIds ?? new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user