22 network_manager = std::make_shared<NetworkManager>(address, login, force_microsoft_account, std::vector<Handler*>(1,
this));
70 std::shared_ptr<ServerboundClientCommandPacket> status_message = std::make_shared<ServerboundClientCommandPacket>();
71 status_message->SetAction(0);
79#if PROTOCOL_VERSION < 765
80 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason().GetRawText());
82 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason());
88#if PROTOCOL_VERSION < 755
93 if (!packet.GetAccepted())
95 std::shared_ptr<ServerboundContainerAckPacket> apologize_packet = std::make_shared<ServerboundContainerAckPacket>();
96 apologize_packet->SetContainerId(packet.GetContainerId());
97 apologize_packet->SetUid(packet.GetUid());
98 apologize_packet->SetAccepted(packet.GetAccepted());
107#if PROTOCOL_VERSION < 765
108 LOG_INFO(
"Disconnect during playing with reason: " << packet.GetReason().GetRawText());
119 std::shared_ptr<ServerboundAcceptTeleportationPacket> confirm_packet = std::make_shared<ServerboundAcceptTeleportationPacket>();
120 confirm_packet->SetId_(packet.GetId_());
125#if PROTOCOL_VERSION > 763
128#if PROTOCOL_VERSION < 765
129 LOG_INFO(
"Disconnect during configuration with reason: " << packet.GetReason().GetRawText());
138#if PROTOCOL_VERSION > 768
141 network_manager->Send(std::make_shared<ServerboundPlayerLoadedPacket>());
146 network_manager->Send(std::make_shared<ServerboundPlayerLoadedPacket>());
#define LOG_INFO(osstream)
void Respawn()
Ask to respawn when dead.
std::shared_ptr< NetworkManager > GetNetworkManager() const
bool GetShouldBeClosed() const
virtual ~ConnectionClient()
void SendChatMessage(const std::string &msg)
Send a message in the game chat.
void SendChatCommand(const std::string &command)
Send a command in the game chat.
virtual void Handle(ProtocolCraft::ClientboundLoginDisconnectPacket &packet) override
void Connect(const std::string &address, const std::string &login, const bool force_microsoft_account=false)
Connect the client to the server at address.
virtual void Disconnect()
std::shared_ptr< NetworkManager > network_manager
void SetShouldBeClosed(const bool b)
std::string Dump(const int indent=-1, const char indent_char=' ') const
public dump interface
virtual Json::Value Serialize() const