1
0

Implement favicon for 1.7.2

Favicon data is a png encoded in base64 which is stored in the server
and sent in the server response packet
This commit is contained in:
Bill Derouin
2014-01-07 09:31:06 -06:00
parent db978fc687
commit 913841f501
4 changed files with 28 additions and 0 deletions

View File

@@ -383,6 +383,16 @@ void cProtocol172::SendExplosion(double a_BlockX, double a_BlockY, double a_Bloc
void cProtocol172::SendFavicon(void)
{
cPacketizer Pkt(*this, 0x0); // Favicon packet
Pkt.WriteString(cRoot::Get()->GetServer()->GetFaviconData());
}
void cProtocol172::SendGameMode(eGameMode a_GameMode)
{
cPacketizer Pkt(*this, 0x2b); // Change Game State packet
@@ -1116,6 +1126,9 @@ void cProtocol172::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
AppendPrintf(Response, "\"description\":{\"text\":\"%s\"}",
cRoot::Get()->GetServer()->GetDescription().c_str()
);
AppendPrintf(Response, "\"favicon\":\"data:image/png;base64,%s\"",
cRoot::Get()->GetServer()->GetFaviconData()
);
Response.append("}");
cPacketizer Pkt(*this, 0x00); // Response packet