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

Method getKey

plugins/webadmin/loops.cpp:225–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void PlayerLoop::getKey(size_t /*item*/, std::string& data, const std::string& key) {
226 bz_BasePlayerRecord* player = bz_getPlayerByIndex(getPlayerID());
227
228 if (player) {
229 if (key == "playerbzid") {
230 data += player->bzID.c_str();
231 }
232 else if (key == "playerid") {
233 data += format("%d", player->playerID);
234 }
235 else if (key == "playercallsign") {
236 data += player->callsign.c_str();
237 }
238 else if (key == "playerguid") {
239 data += format("%d_%s", player->playerID, player->callsign.c_str());
240 }
241 else if (key == "playerip") {
242 data += player->ipAddress.c_str();
243 }
244 else if (key == "playerteam") {
245 data += bzu_GetTeamName(player->team);
246 }
247 else if (key == "playerversion") {
248 data += player->clientVersion.c_str();
249 }
250 else if (key == "playerlag") {
251 data += format("%d", player->lag);
252 }
253 else if (key == "playerjitter") {
254 data += format("%d", player->jitter);
255 }
256 else if (key == "playerpacketloss") {
257 data += format("%f", player->packetLoss);
258 }
259 else if (key == "playerscore") {
260 data += format("%d", player->wins - player->losses - player->teamKills);
261 }
262 else if (key == "playerwins") {
263 data += format("%d", player->wins);
264 }
265 else if (key == "playerlosses") {
266 data += format("%d", player->losses);
267 }
268 else if (key == "playerteamkills") {
269 data += format("%d", player->teamKills);
270 }
271 else if (key == "playerrank") {
272 data += format("%f", player->rank);
273 }
274 else if (key == "playerflag") {
275 data += player->currentFlag.c_str();
276 }
277 else if (key == "playerflagid") {
278 data += format("%d", player->currentFlagID);
279 }
280
281 bz_freePlayerRecord(player);
282 }

Callers

nothing calls this directly

Calls 14

getPlayerIDFunction · 0.85
bzu_GetTeamNameFunction · 0.85
bz_freePlayerRecordFunction · 0.85
bz_getBanItemFunction · 0.85
bz_getBanItemReasonFunction · 0.85
bz_getBanItemSourceFunction · 0.85
bz_getBanItemDurationFunction · 0.85
bz_getReportTimeFunction · 0.85
bz_getReportSourceFunction · 0.85
bz_getReportBodyFunction · 0.85
c_strMethod · 0.80
formatFunction · 0.50

Tested by

no test coverage detected