diff --git a/src/pages/common_pages.cpp b/src/pages/common_pages.cpp index 1b6a6d6..dc202ae 100644 --- a/src/pages/common_pages.cpp +++ b/src/pages/common_pages.cpp @@ -63,6 +63,26 @@ std::string getWeaponName(int modtype) { } } +std::string getGametypeName(int gametype) { + switch(gametype) { + case 0: return "FFA"; + case 1: return "Tournament"; + case 2: return "Single Player"; + case 3: return "TDM"; + case 4: return "CTF"; + case 5: return "One Flag CTF"; + case 6: return "Overload"; + case 7: return "Harvester"; + case 8: return "Elimination"; + case 9: return "CTF Elimination"; + case 10: return "LMS"; + case 11: return "Double Domination"; + case 12: return "Domination"; + case 13: return "Possession"; + default: return "Unknown"; + } +} + // Player management functions OastatPlayer getPlayer(cppdb::session& database, int playerid) { OastatPlayer ret; diff --git a/src/pages/index.cpp b/src/pages/index.cpp index bfb3890..3aa034a 100644 --- a/src/pages/index.cpp +++ b/src/pages/index.cpp @@ -83,6 +83,7 @@ void write_html_index(cppdb::session& database, const std::string& output_dir) { sub_dict->SetValue("EVEN_LINE", (i%2)?"1":"0"); sub_dict->SetValue("GAMENUMBER", std::to_string(game.gamenumber) ); sub_dict->SetValue("MAPNAME", game.mapname); + sub_dict->SetValue("GAMETYPE", getGametypeName(game.gametype)); sub_dict->SetValue("TIME", getTimeStamp(game.time)); sub_dict->SetValue("SERVERNAME", game.servername); } diff --git a/src/pages/pages.hpp b/src/pages/pages.hpp index ac8a1ce..6b73caf 100644 --- a/src/pages/pages.hpp +++ b/src/pages/pages.hpp @@ -52,6 +52,7 @@ void write_html_map(cppdb::session& database, const std::string& mapname, const // Utility functions std::string getWeaponName(int modtype); +std::string getGametypeName(int gametype); std::string getTimeStamp(const tm& _datetime); // Global data accessors diff --git a/templates/index.tpl b/templates/index.tpl index a899c34..186f14b 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -133,6 +133,7 @@ Game Map + Gametype Played at Server name @@ -140,6 +141,7 @@ {{GAMENUMBER}} {{MAPNAME}} + {{GAMETYPE}} {{TIME}} {{SERVERNAME}}