87 std::shared_ptr<ServerboundClientCommandPacket> status_message = std::make_shared<ServerboundClientCommandPacket>();
88 status_message->SetAction(0);
96#if PROTOCOL_VERSION < 765
97 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason().GetRawText());
99 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason());
105#if PROTOCOL_VERSION < 755
110 if (!packet.GetAccepted())
112 std::shared_ptr<ServerboundContainerAckPacket> apologize_packet = std::make_shared<ServerboundContainerAckPacket>();
113 apologize_packet->SetContainerId(packet.GetContainerId());
114 apologize_packet->SetUid(packet.GetUid());
115 apologize_packet->SetAccepted(packet.GetAccepted());
124#if PROTOCOL_VERSION < 765
125 LOG_INFO(
"Disconnect during playing with reason: " << packet.GetReason().GetRawText());
136 std::shared_ptr<ServerboundAcceptTeleportationPacket> confirm_packet = std::make_shared<ServerboundAcceptTeleportationPacket>();
137 confirm_packet->SetId_(packet.GetId_());
142#if PROTOCOL_VERSION > 763
145#if PROTOCOL_VERSION < 765
146 LOG_INFO(
"Disconnect during configuration with reason: " << packet.GetReason().GetRawText());
155#if PROTOCOL_VERSION > 768
158 network_manager->Send(std::make_shared<ServerboundPlayerLoadedPacket>());
163 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 ConnectMinecraftToken(const std::string &address, const std::string &minecraft_token)
Connect the client in online mode using the provided minecraft token.
void ConnectMicrosoft(const std::string &address, const std::string &cache_key="")
Connect the client in online mode.
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)
Connect the client in offline mode if login is not empty, fallback to Microsoft auth flow if empty.
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