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

Function getPlayerFromGUID

plugins/webadmin/actions.cpp:28–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#include <string>
27
28bz_BasePlayerRecord* getPlayerFromGUID(const std::string GUID) {
29 std::vector<std::string> parts = tokenize(GUID, std::string("_"), 2, false);
30 if (parts.size() < 2) {
31 return NULL;
32 }
33
34 int slot = atoi(parts[0].c_str());
35
36 bz_BasePlayerRecord* rec = bz_getPlayerByIndex(slot);
37 if (!rec) {
38 return NULL;
39 }
40
41 if (rec->callsign == parts[1]) {
42 return rec;
43 }
44
45 bz_freePlayerRecord(rec);
46 return NULL;
47}
48
49bool UpdateBZDBVars::process(std::string& inputPage,
50 const HTTPRequest& request, HTTPReply& reply) {

Callers 1

processMethod · 0.85

Calls 4

bz_freePlayerRecordFunction · 0.85
c_strMethod · 0.80
tokenizeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected