From 00c524519ef6c7ceaf4ac91307617cfd65d7cf21 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 14:53:41 +0200 Subject: Fixed style: spaces after commas. --- src/Protocol/Protocol17x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 37a9fdf47..67a5e97b1 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -2533,7 +2533,7 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item) if (!a_Item.m_Enchantments.IsEmpty()) { const char * TagName = (a_Item.m_ItemType == E_ITEM_BOOK) ? "StoredEnchantments" : "ench"; - EnchantmentSerializer::WriteToNBTCompound(a_Item.m_Enchantments,Writer, TagName); + EnchantmentSerializer::WriteToNBTCompound(a_Item.m_Enchantments, Writer, TagName); } if (!a_Item.IsBothNameAndLoreEmpty()) { -- cgit v1.2.3 From 1cb26bda8e3377fd092a348faeb39f7185f60934 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 15:07:28 +0200 Subject: Fixed spaces after commas in protocol data. The JSON data is well-formatted with spaces, too; we can afford to waste the few bytes. --- src/Protocol/Protocol17x.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 67a5e97b1..2707fbf9f 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1712,16 +1712,16 @@ void cProtocol172::HandlePacketStatusPing(cByteBuffer & a_ByteBuffer) void cProtocol172::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer) { // Send the response: - AString Response = "{\"version\":{\"name\":\"1.7.2\",\"protocol\":4},\"players\":{"; + AString Response = "{\"version\":{\"name\":\"1.7.2\", \"protocol\":4}, \"players\":{"; cServer * Server = cRoot::Get()->GetServer(); - AppendPrintf(Response, "\"max\":%u,\"online\":%u,\"sample\":[]},", + AppendPrintf(Response, "\"max\":%u, \"online\":%u, \"sample\":[]},", Server->GetMaxPlayers(), Server->GetNumPlayers() ); AppendPrintf(Response, "\"description\":{\"text\":\"%s\"},", Server->GetDescription().c_str() ); - AppendPrintf(Response, "\"favicon\":\"data:image/png;base64,%s\"", + AppendPrintf(Response, "\"favicon\": \"data:image/png;base64,%s\"", Server->GetFaviconData().c_str() ); Response.append("}"); @@ -3047,15 +3047,15 @@ void cProtocol176::SendPlayerSpawn(const cPlayer & a_Player) void cProtocol176::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer) { // Send the response: - AString Response = "{\"version\":{\"name\":\"1.7.6\",\"protocol\":5},\"players\":{"; - AppendPrintf(Response, "\"max\":%u,\"online\":%u,\"sample\":[]},", + AString Response = "{\"version\": {\"name\": \"1.7.6\", \"protocol\":5}, \"players\": {"; + AppendPrintf(Response, "\"max\": %u, \"online\": %u, \"sample\": []},", cRoot::Get()->GetServer()->GetMaxPlayers(), cRoot::Get()->GetServer()->GetNumPlayers() ); - AppendPrintf(Response, "\"description\":{\"text\":\"%s\"},", + AppendPrintf(Response, "\"description\": {\"text\": \"%s\"},", cRoot::Get()->GetServer()->GetDescription().c_str() ); - AppendPrintf(Response, "\"favicon\":\"data:image/png;base64,%s\"", + AppendPrintf(Response, "\"favicon\": \"data:image/png;base64,%s\"", cRoot::Get()->GetServer()->GetFaviconData().c_str() ); Response.append("}"); -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Protocol/Protocol17x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 2707fbf9f..dadf82716 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1587,7 +1587,7 @@ void cProtocol172::AddReceivedData(const char * a_Data, size_t a_Size) ASSERT(!"Read wrong number of bytes!"); m_Client->PacketError(PacketType); } - } // for(ever) + } // for (ever) // Log any leftover bytes into the logfile: if (g_ShouldLogCommIn && (m_ReceivedData.GetReadableSpace() > 0)) -- cgit v1.2.3