Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions botcraft/src/Game/ConnectionClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Botcraft
void ConnectionClient::Handle(ClientboundLoginDisconnectPacket& packet)
{
#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
LOG_INFO("Disconnect during login with reason: " << packet.GetReason().GetRawText());
LOG_INFO("Disconnect during login with reason: " << packet.GetReason().GetText());
#else
LOG_INFO("Disconnect during login with reason: " << packet.GetReason());
#endif
Expand Down Expand Up @@ -122,9 +122,9 @@ namespace Botcraft
void ConnectionClient::Handle(ClientboundDisconnectPacket& packet)
{
#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
LOG_INFO("Disconnect during playing with reason: " << packet.GetReason().GetRawText());
LOG_INFO("Disconnect during playing with reason: " << packet.GetReason().GetText());
#else
LOG_INFO("Disconnect during playing with reason: " << packet.GetReason().Serialize().Dump());
LOG_INFO("Disconnect during playing with reason: " << packet.GetReason().GetText());
#endif

should_be_closed = true;
Expand All @@ -143,9 +143,9 @@ namespace Botcraft
void ConnectionClient::Handle(ClientboundDisconnectConfigurationPacket& packet)
{
#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
LOG_INFO("Disconnect during configuration with reason: " << packet.GetReason().GetRawText());
LOG_INFO("Disconnect during configuration with reason: " << packet.GetReason().GetText());
#else
LOG_INFO("Disconnect during configuration with reason: " << packet.GetReason().Serialize().Dump());
LOG_INFO("Disconnect during configuration with reason: " << packet.GetReason().GetText());
#endif

should_be_closed = true;
Expand Down
9 changes: 7 additions & 2 deletions protocolCraft/src/Types/Chat/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ namespace ProtocolCraft
}

// Add extra
if (raw.contains("extra") && raw["extra"].is_list_of<NBT::TagCompound>())
if (raw.contains("extra") && raw["extra"].is_list_of<NBT::TagString>())
{
for (const auto& s : raw["extra"].as_list_of<NBT::TagString>())
output += s;
}
else if (raw.contains("extra") && raw["extra"].is_list_of<NBT::TagCompound>())
{
for (const auto& t : raw["extra"].as_list_of<NBT::TagCompound>())
output += ParseChat(t);
output += ParseChat(t);
}

return output;
Expand Down