Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ArrowHead numbers exceeding int32 mappings #104

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static IResult CreateToken([FromQuery] string name, [FromQuery] int limit
audience: options.Value.Authentication.ValidAudiences.First(),
claims: [
new Claim("sub", name),
new Claim(ClaimTypes.Name, name),
new Claim("nbf", $"{DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalSeconds:0}"),
new Claim("iat", $"{DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalSeconds:0}"),
new Claim("exp", $"{DateTime.UtcNow.AddDays(30).Subtract(DateTime.UnixEpoch).TotalSeconds:0}"),
Expand Down
2 changes: 1 addition & 1 deletion src/Helldivers-2-Models/ArrowHead/Assignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Helldivers.Models.ArrowHead;
/// <param name="Setting">Contains detailed information on this assignment like briefing, rewards, ...</param>
public sealed record Assignment(
long Id32,
List<int> Progress,
List<ulong> Progress,
long ExpiresIn,
Setting Setting
);
4 changes: 2 additions & 2 deletions src/Helldivers-2-Models/ArrowHead/Assignments/Reward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
/// <param name="Amount">The amount of <see cref="Type" /> the players will receive upon completion.</param>
public sealed record Reward(
int Type,
int Id32,
int Amount
ulong Id32,
ulong Amount
);
4 changes: 2 additions & 2 deletions src/Helldivers-2-Models/ArrowHead/Assignments/Task.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
/// <param name="ValueTypes">A list of numerical values, purpose unknown.</param>
public sealed record Task(
int Type,
List<int> Values,
List<int> ValueTypes
List<ulong> Values,
List<ulong> ValueTypes
);
2 changes: 1 addition & 1 deletion src/Helldivers-2-Models/ArrowHead/Status/Campaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public sealed record Campaign(
int Id,
int PlanetIndex,
int Type,
int Count
ulong Count
);
2 changes: 1 addition & 1 deletion src/Helldivers-2-Models/V1/Assignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Helldivers.Models.V1;
/// <param name="Expiration">The date when the assignment will expire.</param>
public sealed record Assignment(
long Id,
List<int> Progress,
List<ulong> Progress,
LocalizedMessage Title,
LocalizedMessage Briefing,
LocalizedMessage Description,
Expand Down
2 changes: 1 addition & 1 deletion src/Helldivers-2-Models/V1/Assignments/Reward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
/// <param name="Amount">The amount of <see cref="Type" /> that will be awarded.</param>
public sealed record Reward(
int Type, // TODO: map to enum
int Amount
ulong Amount
);
4 changes: 2 additions & 2 deletions src/Helldivers-2-Models/V1/Assignments/Task.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
/// <param name="ValueTypes">A list of numbers, purpose unknown</param>
public sealed record Task(
int Type,
List<int> Values,
List<int> ValueTypes
List<ulong> Values,
List<ulong> ValueTypes
);
2 changes: 1 addition & 1 deletion src/Helldivers-2-Models/V1/Campaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public record Campaign(
int Id,
Planet Planet,
int Type, // TODO: map to enum
int Count
ulong Count
);