| 1482 | |
| 1483 | |
| 1484 | void cProtocol172::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer) |
| 1485 | { |
| 1486 | // Send the response: |
| 1487 | AString Response = "{\"version\":{\"name\":\"1.7.2\",\"protocol\":4},\"players\":{"; |
| 1488 | AppendPrintf(Response, "\"max\":%u,\"online\":%u,\"sample\":[]},", |
| 1489 | cRoot::Get()->GetServer()->GetMaxPlayers(), |
| 1490 | cRoot::Get()->GetServer()->GetNumPlayers() |
| 1491 | ); |
| 1492 | AppendPrintf(Response, "\"description\":{\"text\":\"%s\"},", |
| 1493 | cRoot::Get()->GetServer()->GetDescription().c_str() |
| 1494 | ); |
| 1495 | AppendPrintf(Response, "\"favicon\":\"data:image/png;base64,%s\"", |
| 1496 | cRoot::Get()->GetServer()->GetFaviconData().c_str() |
| 1497 | ); |
| 1498 | Response.append("}"); |
| 1499 | |
| 1500 | cPacketizer Pkt(*this, 0x00); // Response packet |
| 1501 | Pkt.WriteString(Response); |
| 1502 | } |
| 1503 | |
| 1504 | |
| 1505 |
nothing calls this directly
no test coverage detected