Skip to content

Commit

Permalink
Map PlanetEvent MaxHealth (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambstream authored Apr 4, 2024
1 parent 326128c commit ac46f2a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/Helldivers-2-API/wwwroot/Helldivers-2-API.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,11 @@
"description": "The current health of the planet.",
"format": "int64"
},
"maxHealth": {
"type": "integer",
"description": "The current maximum health of the planet event.",
"format": "int64"
},
"startTime": {
"type": "integer",
"description": "When this event started.",
Expand Down Expand Up @@ -1713,7 +1718,12 @@
},
"health": {
"type": "integer",
"description": "The health of the Planet at the time of snapshot.",
"description": "The health of the Event at the time of snapshot.",
"format": "int64"
},
"maxHealth": {
"type": "integer",
"description": "The maximum health of the Event at the time of snapshot.",
"format": "int64"
},
"startTime": {
Expand Down
5 changes: 5 additions & 0 deletions src/Helldivers-2-API/wwwroot/Helldivers-2-API_arrowhead.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@
"description": "The current health of the planet.",
"format": "int64"
},
"maxHealth": {
"type": "integer",
"description": "The current maximum health of the planet event.",
"format": "int64"
},
"startTime": {
"type": "integer",
"description": "When this event started.",
Expand Down
1 change: 1 addition & 0 deletions src/Helldivers-2-Core/Mapping/V1/PlanetMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Planet MapToV1(PlanetInfo info, PlanetStatus status, PlanetEvent? @event,
EventType: @event.EventType,
Faction: faction ?? string.Empty,
Health: @event.Health,
MaxHealth: @event.MaxHealth,
StartTime: DateTime.UnixEpoch.AddSeconds(@event.StartTime),
EndTime: DateTime.UnixEpoch.AddSeconds(@event.ExpireTime),
CampaignId: @event.CampaignId,
Expand Down
4 changes: 3 additions & 1 deletion src/Helldivers-2-Models/ArrowHead/Status/PlanetEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace Helldivers.Models.ArrowHead.Status;
/// <param name="PlanetIndex">The index of the planet.</param>
/// <param name="EventType">A numerical identifier that indicates what type of event this is.</param>
/// <param name="Race">The identifier of the faction that owns the planet currently.</param>
/// <param name="Health">The current health of the planet.</param>
/// <param name="Health">The current health of the event.</param>
/// <param name="MaxHealth">The current maximum health of the event.</param>
/// <param name="StartTime">When this event started.</param>
/// <param name="ExpireTime">When the event will end.</param>
/// <param name="CampaignId">The unique identifier of a related campaign.</param>
Expand All @@ -20,6 +21,7 @@ public sealed record PlanetEvent(
int EventType,
int Race,
long Health,
long MaxHealth,
long StartTime,
long ExpireTime,
long CampaignId,
Expand Down
4 changes: 3 additions & 1 deletion src/Helldivers-2-Models/V1/Planets/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
/// <param name="Id">The unique identifier of this event.</param>
/// <param name="EventType">The type of event.</param>
/// <param name="Faction">The faction that initiated the event.</param>
/// <param name="Health">The health of the <see cref="Planet" /> at the time of snapshot.</param>
/// <param name="Health">The health of the <see cref="Event" /> at the time of snapshot.</param>
/// <param name="MaxHealth">The maximum health of the <see cref="Event" /> at the time of snapshot.</param>
/// <param name="StartTime">When the event started.</param>
/// <param name="EndTime">When the event will end.</param>
/// <param name="CampaignId">The identifier of the <see cref="Campaign" /> linked to this event.</param>
Expand All @@ -16,6 +17,7 @@ public sealed record Event(
int EventType,
string Faction,
long Health,
long MaxHealth,
DateTime StartTime,
DateTime EndTime,
long CampaignId,
Expand Down

0 comments on commit ac46f2a

Please sign in to comment.