1
0

ProtoProxy: Fixed description-changing to work with 1.7.4.

This commit is contained in:
madmaxoft 2013-12-15 20:41:35 +01:00
parent 4ee4cab2d3
commit c19f2d7383

View File

@ -2384,10 +2384,11 @@ bool cConnection::HandleServerStatusResponse(void)
Log(" Response: %s", Response.c_str()); Log(" Response: %s", Response.c_str());
// Modify the response to show that it's being proto-proxied: // Modify the response to show that it's being proto-proxied:
size_t idx = Response.find("\"description\":\""); const char DescSearch[] = "\"description\":{\"text\":\"";
size_t idx = Response.find(DescSearch);
if (idx != AString::npos) if (idx != AString::npos)
{ {
Response.assign(Response.substr(0, idx + 15) + "ProtoProxy: " + Response.substr(idx + 15)); Response.assign(Response.substr(0, idx + sizeof(DescSearch) - 1) + "ProtoProxy: " + Response.substr(idx + sizeof(DescSearch) - 1));
} }
cByteBuffer Packet(1000); cByteBuffer Packet(1000);
Packet.WriteVarInt(0); // Packet type - status response Packet.WriteVarInt(0); // Packet type - status response