Skip to content

Commit

Permalink
Record all player stats in replay file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Janzert committed Nov 14, 2017
1 parent db94c51 commit a853682
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions environment/core/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ auto to_json(nlohmann::json& json, const GameStatistics& stats) -> void {
auto& player_stats = stats.player_statistics[player_id];
json[std::to_string(static_cast<int>(player_id))] = nlohmann::json{
{ "rank", player_stats.rank },
{ "last_frame_alive", player_stats.last_frame_alive },
{ "total_ship_count", player_stats.total_ship_count },
{ "damage_dealt", player_stats.damage_dealt },
{ "init_response_time", player_stats.init_response_time },
{ "average_frame_response_time", player_stats.average_frame_response_time },
};
}
}

0 comments on commit a853682

Please sign in to comment.