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

Map PlanetEvent MaxHealth #45

Merged
merged 1 commit into from
Apr 4, 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
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
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>
dealloc marked this conversation as resolved.
Show resolved Hide resolved
/// <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