X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=2089dd17c8eec85a7acf7e6e7d3d930f03946a5f;hb=b066e776622f96e906600a0c4a08de392bd03676;hp=99657de3642d262b70dbdcee5504e32efb66680b;hpb=e1209ec25c4cc91e13889876106f56bd51aa96e2;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index 99657de..2089dd1 100644 --- a/src/server/ClientConnection.hpp +++ b/src/server/ClientConnection.hpp @@ -47,13 +47,13 @@ public: /// send the previously prepared packet of non-default length std::uint16_t Send(std::size_t len); - void AttachPlayer(const Player &); + void AttachPlayer(Player &); void DetachPlayer(); - bool HasPlayer() const noexcept { return player.entity; } - Entity &PlayerEntity() noexcept { return *player.entity; } - const Entity &PlayerEntity() const noexcept { return *player.entity; } - ChunkIndex &PlayerChunks() noexcept { return *player.chunks; } - const ChunkIndex &PlayerChunks() const noexcept { return *player.chunks; } + bool HasPlayer() const noexcept { return player; } + Entity &PlayerEntity() noexcept { return player->GetEntity(); } + const Entity &PlayerEntity() const noexcept { return player->GetEntity(); } + ChunkIndex &PlayerChunks() noexcept { return player->GetChunks(); } + const ChunkIndex &PlayerChunks() const noexcept { return player->GetChunks(); } void SetPlayerModel(const CompositeModel &) noexcept; bool HasPlayerModel() const noexcept; @@ -95,7 +95,7 @@ private: private: Server &server; Connection conn; - Player player; + Player *player; const CompositeModel *player_model; std::list spawns; unsigned int confirm_wait;