| 106 | } |
| 107 | |
| 108 | void StatsLink::buildHTMLPlayer(std::string& params, int playerID, int index) { |
| 109 | GameKeeper::Player* player = GameKeeper::Player::getPlayerByIndex(playerID); |
| 110 | if (player) { |
| 111 | params += TextUtils::format("&callsign%d=%s", index, TextUtils::url_encode(std::string(player->player.getCallSign())).c_str()); |
| 112 | |
| 113 | if (player->hasCustomField("motto") && player->customData["motto"].size()) { |
| 114 | params += TextUtils::format("&motto%d=%s", index, TextUtils::url_encode(player->customData["motto"]).c_str()); |
| 115 | } |
| 116 | |
| 117 | params += TextUtils::format("&team%d=%s", index, TextUtils::url_encode(std::string(getTeamName(player->player.getTeam()))).c_str()); |
| 118 | |
| 119 | std::string BZID = player->getBzIdentifier(); |
| 120 | if (!BZID.size()) { |
| 121 | BZID = "none"; |
| 122 | } |
| 123 | params += TextUtils::format("&bzID%d=%s", index, TextUtils::url_encode(BZID).c_str()); |
| 124 | |
| 125 | std::string Token = player->player.getToken(); |
| 126 | if (!Token.size()) { |
| 127 | Token = "none"; |
| 128 | } |
| 129 | params += TextUtils::format("&token%d=%s", index, TextUtils::url_encode(Token).c_str()); |
| 130 | |
| 131 | if (player->player.OSVersion.size()) { |
| 132 | params += TextUtils::format("&osvers%d=%s", index, TextUtils::url_encode(player->player.OSVersion).c_str()); |
| 133 | } |
| 134 | |
| 135 | if (player->player.getTeam() != ObserverTeam) { |
| 136 | params += TextUtils::format("&wins%d=%d", index, player->score.getWins()); |
| 137 | params += TextUtils::format("&losses%d=%d", index, player->score.getLosses()); |
| 138 | params += TextUtils::format("&teamkills%d=%d", index, player->score.getTKs()); |
| 139 | } |
| 140 | params += TextUtils::format("&version%d=%s", index, TextUtils::url_encode(std::string(player->player.getClientVersion())).c_str()); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void StatsLink::buildHTMLPlayerList(std::string& params, int skip) { |
| 145 | bz_APIIntList* players = bz_getPlayerIndexList(); |
nothing calls this directly
no test coverage detected