![]() |
Botcraft 1.21.4
|
A client containing the different managers, and performing client-side physics. More...
#include <ManagersClient.hpp>
Public Member Functions | |
ManagersClient (const bool use_renderer_) | |
virtual | ~ManagersClient () |
virtual void | Disconnect () override |
void | SetSharedWorld (const std::shared_ptr< World > world_) |
bool | GetAutoRespawn () const |
void | SetAutoRespawn (const bool b) |
int | SendInventoryTransaction (const std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > &transaction) |
std::shared_ptr< World > | GetWorld () const |
std::shared_ptr< EntityManager > | GetEntityManager () const |
std::shared_ptr< LocalPlayer > | GetLocalPlayer () const |
std::shared_ptr< InventoryManager > | GetInventoryManager () const |
std::shared_ptr< PhysicsManager > | GetPhysicsManager () const |
std::string | GetPlayerName (const ProtocolCraft::UUID &uuid) const |
Get the name of a connected player. | |
int | GetDayTime () const |
Get the current tick. | |
![]() | |
ConnectionClient () | |
virtual | ~ConnectionClient () |
void | Connect (const std::string &address, const std::string &login, const bool force_microsoft_account=false) |
Connect the client to the server at address. | |
bool | GetShouldBeClosed () const |
void | SetShouldBeClosed (const bool b) |
std::shared_ptr< NetworkManager > | GetNetworkManager () const |
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. | |
void | Respawn () |
Ask to respawn when dead. | |
Protected Attributes | |
std::shared_ptr< World > | world |
std::shared_ptr< EntityManager > | entity_manager |
std::shared_ptr< InventoryManager > | inventory_manager |
std::shared_ptr< PhysicsManager > | physics_manager |
bool | use_renderer |
std::shared_ptr< Renderer::RenderingManager > | rendering_manager |
bool | auto_respawn |
Difficulty | difficulty |
bool | difficulty_locked |
bool | is_hardcore |
std::atomic< int > | day_time |
std::map< ProtocolCraft::UUID, std::string > | player_names |
Names of all connected players. | |
std::shared_mutex | player_names_mutex |
![]() | |
std::shared_ptr< NetworkManager > | network_manager |
bool | should_be_closed |
A client containing the different managers, and performing client-side physics.
Can be inherited if you want to handle other packets without a need of any behaviour tree stuff.
Definition at line 30 of file ManagersClient.hpp.
Botcraft::ManagersClient::ManagersClient | ( | const bool | use_renderer_ | ) |
Definition at line 23 of file ManagersClient.cpp.
References auto_respawn, difficulty, difficulty_locked, entity_manager, Botcraft::AssetsManager::getInstance(), inventory_manager, is_hardcore, LOG_WARNING, Botcraft::None, physics_manager, rendering_manager, use_renderer, and world.
|
virtual |
Definition at line 51 of file ManagersClient.cpp.
References Disconnect().
|
overridevirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 56 of file ManagersClient.cpp.
References difficulty, difficulty_locked, Botcraft::ConnectionClient::Disconnect(), entity_manager, inventory_manager, is_hardcore, Botcraft::ConnectionClient::network_manager, Botcraft::None, physics_manager, player_names, player_names_mutex, rendering_manager, and world.
Referenced by ~ManagersClient().
bool Botcraft::ManagersClient::GetAutoRespawn | ( | ) | const |
Definition at line 120 of file ManagersClient.cpp.
References auto_respawn.
int Botcraft::ManagersClient::GetDayTime | ( | ) | const |
Get the current tick.
Definition at line 95 of file ManagersClient.cpp.
References day_time.
Referenced by Botcraft::IsNightTime().
std::shared_ptr< EntityManager > Botcraft::ManagersClient::GetEntityManager | ( | ) | const |
Definition at line 135 of file ManagersClient.cpp.
References entity_manager.
Referenced by Botcraft::InteractEntityImpl(), and Botcraft::PlaceBlockImpl().
std::shared_ptr< InventoryManager > Botcraft::ManagersClient::GetInventoryManager | ( | ) | const |
Definition at line 145 of file ManagersClient.cpp.
References inventory_manager.
Referenced by Botcraft::ClickSlotInContainerImpl(), Botcraft::CloseContainerImpl(), Botcraft::CraftImpl(), Botcraft::DigImpl(), Botcraft::DropItemsFromContainerImpl(), Botcraft::EatImpl(), Botcraft::HasItemInInventoryImpl(), Botcraft::LogInventoryContentImpl(), Botcraft::OpenContainerImpl(), Botcraft::PlaceBlockImpl(), Botcraft::SetItemInHandImpl(), Botcraft::SortInventory(), and Botcraft::TradeImpl().
std::shared_ptr< LocalPlayer > Botcraft::ManagersClient::GetLocalPlayer | ( | ) | const |
Definition at line 140 of file ManagersClient.cpp.
References entity_manager.
Referenced by Botcraft::AdjustPosSpeed(), Botcraft::DigImpl(), Botcraft::FindPath(), Botcraft::GoToImpl(), Botcraft::InteractWithBlockImpl(), Botcraft::IsAlive(), Botcraft::IsHungryImpl(), Botcraft::LookAtImpl(), Botcraft::StartFlying(), Botcraft::StopFlying(), and Botcraft::SyncPosRotToServer().
std::shared_ptr< PhysicsManager > Botcraft::ManagersClient::GetPhysicsManager | ( | ) | const |
Definition at line 150 of file ManagersClient.cpp.
References physics_manager.
Referenced by Botcraft::AdjustPosSpeed(), Botcraft::DigImpl(), Botcraft::EatImpl(), Botcraft::GoToImpl(), Botcraft::Move(), Botcraft::PlaceBlockImpl(), Botcraft::StartFlying(), Botcraft::StopFlying(), and Botcraft::SyncPosRotToServer().
std::string Botcraft::ManagersClient::GetPlayerName | ( | const ProtocolCraft::UUID & | uuid | ) | const |
Get the name of a connected player.
uuid | UUID of the player |
Definition at line 155 of file ManagersClient.cpp.
References entity_manager, Botcraft::ConnectionClient::network_manager, player_names, and player_names_mutex.
std::shared_ptr< World > Botcraft::ManagersClient::GetWorld | ( | ) | const |
Definition at line 130 of file ManagersClient.cpp.
References world.
Referenced by Botcraft::DigImpl(), Botcraft::EatImpl(), Botcraft::FindPath(), Botcraft::GoToImpl(), Botcraft::InteractWithBlockImpl(), Botcraft::Move(), and Botcraft::PlaceBlockImpl().
|
overrideprotectedvirtual |
Definition at line 208 of file ManagersClient.cpp.
References difficulty, and difficulty_locked.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 49 of file ConnectionClient.cpp.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 46 of file ConnectionClient.cpp.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 42 of file ConnectionClient.cpp.
|
overrideprotectedvirtual |
Definition at line 178 of file ManagersClient.cpp.
References Botcraft::CHUNK_WIDTH.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 52 of file ConnectionClient.cpp.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 216 of file ManagersClient.cpp.
References difficulty, Botcraft::ConnectionClient::Handle(), and is_hardcore.
|
overrideprotectedvirtual |
Definition at line 241 of file ManagersClient.cpp.
References Botcraft::Enabled, and Botcraft::ConnectionClient::network_manager.
|
overrideprotectedvirtual |
Definition at line 329 of file ManagersClient.cpp.
References player_names, and player_names_mutex.
|
overrideprotectedvirtual |
Definition at line 338 of file ManagersClient.cpp.
References player_names, and player_names_mutex.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 47 of file ConnectionClient.cpp.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 268 of file ManagersClient.cpp.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 53 of file ConnectionClient.cpp.
References Botcraft::ConnectionClient::network_manager.
|
overrideprotectedvirtual |
Reimplemented from Botcraft::ConnectionClient.
Definition at line 273 of file ManagersClient.cpp.
References difficulty, and Botcraft::ConnectionClient::Handle().
|
overrideprotectedvirtual |
Definition at line 233 of file ManagersClient.cpp.
References auto_respawn, and Botcraft::ConnectionClient::Respawn().
|
overrideprotectedvirtual |
Definition at line 284 of file ManagersClient.cpp.
References day_time.
int Botcraft::ManagersClient::SendInventoryTransaction | ( | const std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > & | transaction | ) |
Definition at line 100 of file ManagersClient.cpp.
References inventory_manager, and Botcraft::ConnectionClient::network_manager.
Referenced by Botcraft::ClickSlotInContainerImpl().
void Botcraft::ManagersClient::SetAutoRespawn | ( | const bool | b | ) |
Definition at line 125 of file ManagersClient.cpp.
References auto_respawn.
void Botcraft::ManagersClient::SetSharedWorld | ( | const std::shared_ptr< World > | world_ | ) |
Definition at line 115 of file ManagersClient.cpp.
References world.
|
protected |
Definition at line 98 of file ManagersClient.hpp.
Referenced by GetAutoRespawn(), Handle(), ManagersClient(), and SetAutoRespawn().
|
protected |
Definition at line 105 of file ManagersClient.hpp.
Referenced by GetDayTime(), and Handle().
|
protected |
Definition at line 100 of file ManagersClient.hpp.
Referenced by Disconnect(), Handle(), Handle(), Handle(), and ManagersClient().
|
protected |
Definition at line 102 of file ManagersClient.hpp.
Referenced by Disconnect(), Handle(), and ManagersClient().
|
protected |
Definition at line 87 of file ManagersClient.hpp.
Referenced by Disconnect(), GetEntityManager(), GetLocalPlayer(), GetPlayerName(), and ManagersClient().
|
protected |
Definition at line 88 of file ManagersClient.hpp.
Referenced by Disconnect(), GetInventoryManager(), ManagersClient(), and SendInventoryTransaction().
|
protected |
Definition at line 104 of file ManagersClient.hpp.
Referenced by Disconnect(), Handle(), and ManagersClient().
|
protected |
Definition at line 89 of file ManagersClient.hpp.
Referenced by Disconnect(), GetPhysicsManager(), and ManagersClient().
|
protected |
Names of all connected players.
Definition at line 108 of file ManagersClient.hpp.
Referenced by Disconnect(), GetPlayerName(), Handle(), and Handle().
|
mutableprotected |
Definition at line 109 of file ManagersClient.hpp.
Referenced by Disconnect(), GetPlayerName(), Handle(), and Handle().
|
protected |
Definition at line 95 of file ManagersClient.hpp.
Referenced by Disconnect(), ManagersClient(), Botcraft::TemplatedBehaviourClient< TDerived >::OnFullTreeStart(), Botcraft::TemplatedBehaviourClient< TDerived >::OnNodeEndTick(), Botcraft::TemplatedBehaviourClient< TDerived >::OnNodeStartTick(), Botcraft::TemplatedBehaviourClient< TDerived >::OnNodeTickChild(), Botcraft::BehaviourClient::OnReset(), Botcraft::TemplatedBehaviourClient< TDerived >::OnTreeChanged(), Botcraft::BehaviourClient::OnValueChanged(), and Botcraft::BehaviourClient::OnValueRemoved().
|
protected |
Definition at line 94 of file ManagersClient.hpp.
Referenced by ManagersClient().
|
protected |
Definition at line 86 of file ManagersClient.hpp.
Referenced by Disconnect(), GetWorld(), ManagersClient(), and SetSharedWorld().