MCPcopy Create free account
hub / github.com/cuberite/cuberite / HandleServerStatusResponse

Method HandleServerStatusResponse

Tools/ProtoProxy/Connection.cpp:2391–2413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2389
2390
2391bool cConnection::HandleServerStatusResponse(void)
2392{
2393 HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, Response);
2394 Log("Received server's status response:");
2395 Log(" Response: %s", Response.c_str());
2396
2397 // Modify the response to show that it's being proto-proxied:
2398 const char DescSearch[] = "\"description\":{\"text\":\"";
2399 size_t idx = Response.find(DescSearch);
2400 if (idx != AString::npos)
2401 {
2402 Response.assign(Response.substr(0, idx + sizeof(DescSearch) - 1) + "ProtoProxy: " + Response.substr(idx + sizeof(DescSearch) - 1));
2403 }
2404 cByteBuffer Packet(Response.size() + 50);
2405 Packet.WriteVarInt(0); // Packet type - status response
2406 Packet.WriteVarUTF8String(Response);
2407 AString Pkt;
2408 Packet.ReadAll(Pkt);
2409 cByteBuffer ToClient(Response.size() + 50);
2410 ToClient.WriteVarUTF8String(Pkt);
2411 CLIENTSEND(ToClient);
2412 return true;
2413}
2414
2415
2416

Callers

nothing calls this directly

Calls 5

c_strMethod · 0.80
sizeMethod · 0.80
ReadAllMethod · 0.80
WriteVarIntMethod · 0.45
WriteVarUTF8StringMethod · 0.45

Tested by

no test coverage detected