#ifndef PAGES_HPP #define PAGES_HPP #include #include #include #include #include #include #include "../common/common.hpp" // Struct definitions (that are specific to pages) struct OastatGame { int gamenumber = 0; int gametype = 0; std::string mapname; tm time = {}; std::string basegame; int second = 0; std::string servername; }; struct ScorePoint { int playerid = 0; int second = 0; int score = 0; }; // Player management OastatPlayer getPlayer(cppdb::session& database, int playerid); std::vector get_top_killers(cppdb::session& database, int count); void populate_player_deaths(cppdb::session& database, const std::vector& player_ids); void populate_player_awards(cppdb::session& database, const std::vector& player_ids); void populate_player_kills(cppdb::session& database, const std::vector& player_ids); // Map management std::vector get_most_played_maps(cppdb::session& database); void getMapWeaponKills(cppdb::session& database, const std::string& mapname, std::map& weapon_kills); void getMapRecentGames(cppdb::session& database, const std::string& mapname, std::vector& games); // Game management void getRecentGames(cppdb::session& database, std::vector& games); void getGameScoreTotal(cppdb::session& database, int gamenumber, std::vector>& scores); void getGameScoreProgression(cppdb::session& database, int gamenumber, std::vector& progression); // Page generation functions void write_html_index(cppdb::session& database, const std::string& output_dir); void write_html_game(cppdb::session& database, const OastatGame& game, const std::string& output_dir); void write_html_map(cppdb::session& database, const std::string& mapname, const std::string& output_dir); // Utility functions std::string getWeaponName(int modtype); std::string getTimeStamp(const tm& _datetime); // Global data accessors std::map& get_kills_by_player(); std::map& get_player_deaths(); std::map>& get_player_awards(); std::map>& get_player_weapon_kills(); std::map& get_map_infos(); std::set& get_generated_games(); std::set& get_generated_maps(); #endif // PAGES_HPP