Skip to content

Commit

Permalink
fix ArrowHead numbers exceeding int32 mappings (#104)
Browse files Browse the repository at this point in the history
* fix ArrowHead numbers exceeding int32 mappings

* sneaking in a dev key fix
  • Loading branch information
dealloc authored May 18, 2024
1 parent 08a0fc5 commit 9c6869c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/Helldivers-2-API/Controllers/DevelopmentController.cs
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
);

0 comments on commit 9c6869c

Please sign in to comment.