-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement player count per platform and player list API endpoints (#1014
) * Implement player count per platform and player list API endpoints * Fix inconsistencies in the XML documentation * Update PlayerListResponse.cs
- Loading branch information
Showing
5 changed files
with
113 additions
and
10 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
28 changes: 26 additions & 2 deletions
28
ProjectLighthouse.Servers.API/Responses/PlayerCountResponse.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 |
---|---|---|
@@ -1,13 +1,37 @@ | ||
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses; | ||
|
||
[JsonDerivedType(typeof(PlayerCountByGameObject))] | ||
[JsonDerivedType(typeof(PlayerCountByPlatformObject))] | ||
public class PlayerCountObject | ||
{ | ||
public string Game { get; set; } = ""; | ||
public int PlayerCount { get; set; } | ||
} | ||
|
||
public class PlayerCountByGameObject : PlayerCountObject | ||
{ | ||
public string Game { get; set; } = ""; | ||
} | ||
|
||
public class PlayerCountByPlatformObject : PlayerCountObject | ||
{ | ||
public string Platform { get; set; } = ""; | ||
} | ||
|
||
[JsonDerivedType(typeof(PlayerCountByGameResponse))] | ||
[JsonDerivedType(typeof(PlayerCountByPlatformResponse))] | ||
public class PlayerCountResponse | ||
{ | ||
public int TotalPlayerCount { get; set; } | ||
} | ||
|
||
public class PlayerCountByGameResponse : PlayerCountResponse | ||
{ | ||
public List<PlayerCountObject> Games { get; set; } = new(); | ||
} | ||
|
||
public class PlayerCountByPlatformResponse : PlayerCountResponse | ||
{ | ||
public List<PlayerCountObject> Platforms { get; set; } = new(); | ||
} |
13 changes: 13 additions & 0 deletions
13
ProjectLighthouse.Servers.API/Responses/PlayerListResponse.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,13 @@ | ||
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses; | ||
|
||
public class PlayerListResponse | ||
{ | ||
public required List<PlayerListObject> Players { get; set; } | ||
} | ||
|
||
public class PlayerListObject | ||
{ | ||
public required string Username { get; set; } | ||
public required string Game { get; set; } | ||
public required string Platform { get; set; } | ||
} |
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