X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=99657de3642d262b70dbdcee5504e32efb66680b;hb=8fdc24f0b3fb287f5d4e1c7d1f85ad85d5ed2414;hp=c5efb51bbd412d7d9aeffbe7e5b29803b83f4a2d;hpb=8ae45b6555d55f301f83daf8c1337d332d8305ab;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index c5efb51..99657de 100644 --- a/src/server/ClientConnection.hpp +++ b/src/server/ClientConnection.hpp @@ -12,9 +12,13 @@ #include #include #include +#include namespace blank { + +class CompositeModel; + namespace server { class Server; @@ -51,6 +55,10 @@ public: ChunkIndex &PlayerChunks() noexcept { return *player.chunks; } const ChunkIndex &PlayerChunks() const noexcept { return *player.chunks; } + void SetPlayerModel(const CompositeModel &) noexcept; + bool HasPlayerModel() const noexcept; + const CompositeModel &GetPlayerModel() const noexcept; + private: struct SpawnStatus { // the entity in question @@ -77,7 +85,8 @@ private: void SendSpawn(SpawnStatus &); void SendDespawn(SpawnStatus &); - void SendUpdate(SpawnStatus &); + void QueueUpdate(SpawnStatus &); + void SendUpdates(); void CheckPlayerFix(); @@ -87,9 +96,12 @@ private: Server &server; Connection conn; Player player; + const CompositeModel *player_model; std::list spawns; unsigned int confirm_wait; + std::vector entity_updates; + EntityState player_update_state; std::uint16_t player_update_pack; IntervalTimer player_update_timer;