This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from aspriddell/replace-level-stats-api
Replace level stats api
- Loading branch information
Showing
15 changed files
with
113 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Dragon6 API Copyright DragonFruit Network <inbox@dragonfruit.network> | ||
// Licensed under Apache-2. Refer to the LICENSE file for more info | ||
|
||
using System.Threading.Tasks; | ||
using DragonFruit.Six.Api.Accounts; | ||
using DragonFruit.Six.Api.Accounts.Entities; | ||
using NUnit.Framework; | ||
|
||
namespace DragonFruit.Six.Api.Tests.Data | ||
{ | ||
[TestFixture] | ||
public class AccountLevelTests : Dragon6ApiTest | ||
{ | ||
[TestCaseSource(nameof(Accounts))] | ||
public async Task GetAccountLevel(UbisoftAccount account) | ||
{ | ||
var level = await Client.GetAccountLevelAsync(account).ConfigureAwait(false); | ||
|
||
if (level.Level == 0) | ||
{ | ||
Assert.Inconclusive("User level has not been synchronised across all platforms"); | ||
} | ||
|
||
Assert.GreaterOrEqual(level.Level, 5); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Dragon6 API Copyright DragonFruit Network <inbox@dragonfruit.network> | ||
// Licensed under Apache-2. Refer to the LICENSE file for more info | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace DragonFruit.Six.Api.Accounts.Entities | ||
{ | ||
public class AccountLevel | ||
{ | ||
[JsonProperty("level")] | ||
public int Level { get; set; } | ||
|
||
[JsonProperty("xp")] | ||
public int XP { get; set; } | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
DragonFruit.Six.Api/Accounts/Requests/AccountLevelRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Dragon6 API Copyright DragonFruit Network <inbox@dragonfruit.network> | ||
// Licensed under Apache-2. Refer to the LICENSE file for more info | ||
|
||
using DragonFruit.Data.Parameters; | ||
using DragonFruit.Six.Api.Accounts.Entities; | ||
using DragonFruit.Six.Api.Accounts.Enums; | ||
using JetBrains.Annotations; | ||
|
||
namespace DragonFruit.Six.Api.Accounts.Requests | ||
{ | ||
public class AccountLevelRequest : UbiApiRequest | ||
{ | ||
public override string Path => Platform.CrossPlatform.SpaceUrl(1) + "/title/r6s/rewards/public_profile"; | ||
|
||
public AccountLevelRequest(UbisoftAccount account) | ||
{ | ||
Account = account; | ||
} | ||
|
||
public UbisoftAccount Account { get; } | ||
|
||
[UsedImplicitly] | ||
[QueryParameter("profile_id")] | ||
private string ProfileId => Account.ProfileId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
DragonFruit.Six.Api/Legacy/Requests/PlayerLevelStatsRequest.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ public enum Region | |
{ | ||
EMEA = 1, | ||
NCSA = 2, | ||
APAC = 4, | ||
|
||
All = EMEA | NCSA | APAC | ||
APAC = 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters