mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-21 20:27:02 +00:00
fix invalid players from showing up in api response
This commit is contained in:
parent
9542216650
commit
3faf9eea45
@ -17,7 +17,11 @@ void to_json(json& data, const PlayerData& playerData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void to_json(json& data, const PlayerContainer& playerContainer) {
|
void to_json(json& data, const PlayerContainer& playerContainer) {
|
||||||
data = playerContainer.GetAllPlayers();
|
data = json::array();
|
||||||
|
for(auto& playerData : playerContainer.GetAllPlayers()) {
|
||||||
|
if (playerData.first == LWOOBJID_EMPTY) continue;
|
||||||
|
data.push_back(playerData.second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void to_json(json& data, const TeamContainer& teamContainer) {
|
void to_json(json& data, const TeamContainer& teamContainer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user