MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / handleRequest

Method handleRequest

plugins/webstats/webstats.cpp:876–903  ·  view source on GitHub ↗

void WebStats::getURLData(const char* url, int requestID, const URLParams &paramaters, bool get)

Source from the content-addressed store, hash-verified

874
875//void WebStats::getURLData(const char* url, int requestID, const URLParams &paramaters, bool get)
876bool WebStats::handleRequest(const HTTPRequest& request, HTTPReply& reply) {
877 groupLoop = 0;
878 flagHistoryLoop = 0;
879 playeRecord = NULL;
880 flagReportID = -1;
881
882 std::string& page = reply.body;
883 templateSystem.startTimer();
884
885 std::string action, playerID, flagID;
886 request.getParam("action", action);
887 request.getParam("playerid", playerID);
888 request.getParam("flagid", flagID);
889
890 if (action == "player" && playerID.size()) {
891 doPlayerReport(page, atoi(playerID.c_str()));
892 }
893 if (action == "flag" && flagID.size()) {
894 doFlagReport(page, atoi(flagID.c_str()));
895 }
896 else {
897 doStatReport(page, action);
898 }
899
900 reply.docType = HTTPReply::eHTML;
901
902 return true;
903}
904
905// Local Variables: ***
906// mode: C++ ***

Callers 2

generatePageMethod · 0.45
updateMethod · 0.45

Calls 4

startTimerMethod · 0.80
c_strMethod · 0.80
getParamMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected