38 std::vector<Handler*>{
this },
56 std::vector<Handler*>{
this },
73 std::vector<Handler*>{
this },
123 std::shared_ptr<ServerboundClientCommandPacket> status_message = std::make_shared<ServerboundClientCommandPacket>();
124 status_message->SetAction(0);
132#if PROTOCOL_VERSION < 765
133 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason().GetText());
135 LOG_INFO(
"Disconnect during login with reason: " << packet.GetReason());
141#if PROTOCOL_VERSION < 755
146 if (!packet.GetAccepted())
148 std::shared_ptr<ServerboundContainerAckPacket> apologize_packet = std::make_shared<ServerboundContainerAckPacket>();
149 apologize_packet->SetContainerId(packet.GetContainerId());
150 apologize_packet->SetUid(packet.GetUid());
151 apologize_packet->SetAccepted(packet.GetAccepted());
160#if PROTOCOL_VERSION < 765
161 LOG_INFO(
"Disconnect during playing with reason: " << packet.GetReason().GetText());
172 std::shared_ptr<ServerboundAcceptTeleportationPacket> confirm_packet = std::make_shared<ServerboundAcceptTeleportationPacket>();
173 confirm_packet->SetId_(packet.GetId_());
178#if PROTOCOL_VERSION > 763
181#if PROTOCOL_VERSION < 765
182 LOG_INFO(
"Disconnect during configuration with reason: " << packet.GetReason().GetText());
191#if PROTOCOL_VERSION > 768
194 network_manager->Send(std::make_shared<ServerboundPlayerLoadedPacket>());
199 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
std::atomic< bool > should_be_closed
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