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

Function handleQueryGL

src/bzflag/guiplaying.cpp:2705–2730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2703
2704
2705void handleQueryGL(void* msg) {
2706 std::string queryStr;
2707 msg = nboUnpackStdString(msg, queryStr);
2708
2709 std::string result = getQueryGLResult(queryStr);
2710
2711 std::vector<std::string> results;
2712 const std::string prefix = "QueryGL/" + queryStr + ": ";
2713 const size_t maxLen = MessageLen - prefix.size() - 15;
2714 while (!result.empty()) {
2715 if (result.size() > maxLen) {
2716 results.push_back(prefix + result.substr(0, maxLen));
2717 result = result.substr(maxLen);
2718 }
2719 else {
2720 results.push_back(prefix + result);
2721 result.clear();
2722 }
2723 }
2724
2725 for (size_t r = 0; r < results.size(); r++) {
2726 char buf[MessageLen];
2727 strncpy(buf, results[r].c_str(), MessageLen);
2728 serverLink->sendMessage(ServerPlayer, buf);
2729 }
2730}
2731
2732void handleQueryOS(void* msg) {
2733 uint8_t id;

Callers 1

handleServerMessageFunction · 0.50

Calls 8

nboUnpackStdStringFunction · 0.85
getQueryGLResultFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45
sendMessageMethod · 0.45

Tested by

no test coverage detected