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: " << msg.GetReason().GetRawText());
82 LOG_INFO(
"Disconnect during login with reason: " << msg.GetReason());
88#if PROTOCOL_VERSION < 755
93 if (!msg.GetAccepted())
95 std::shared_ptr<ServerboundContainerAckPacket> apologize_msg = std::make_shared<ServerboundContainerAckPacket>();
96 apologize_msg->SetContainerId(msg.GetContainerId());
97 apologize_msg->SetUid(msg.GetUid());
98 apologize_msg->SetAccepted(msg.GetAccepted());
107#if PROTOCOL_VERSION < 765
108 LOG_INFO(
"Disconnect during playing with reason: " << msg.GetReason().GetRawText());
119 std::shared_ptr<ServerboundAcceptTeleportationPacket> confirm_msg = std::make_shared<ServerboundAcceptTeleportationPacket>();
120 confirm_msg->SetId_(msg.GetId_());
125#if PROTOCOL_VERSION > 763
128#if PROTOCOL_VERSION < 765
129 LOG_INFO(
"Disconnect during configuration with reason: " << msg.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.
virtual void Handle(ProtocolCraft::ClientboundLoginDisconnectPacket &msg) override
void SendChatCommand(const std::string &command)
Send a command in the game chat.
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