X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=16beccf7aecb100471185aca85cd684023e2d6c8;hb=8e9e2bb4b2dd5a4100f4531628ab58002fe253c1;hp=9aaae128d4c43ead42c6fac689f0b006cae3025b;hpb=933ca0fe6c660e482edd45742d981f2de59a32df;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index 9aaae12..16beccf 100644 --- a/src/server/ClientConnection.hpp +++ b/src/server/ClientConnection.hpp @@ -19,7 +19,7 @@ namespace blank { -class CompositeModel; +class Model; namespace server { @@ -57,9 +57,9 @@ public: ChunkIndex &PlayerChunks() noexcept { return input->GetPlayer().GetChunks(); } const ChunkIndex &PlayerChunks() const noexcept { return input->GetPlayer().GetChunks(); } - void SetPlayerModel(const CompositeModel &) noexcept; + void SetPlayerModel(const Model &) noexcept; bool HasPlayerModel() const noexcept; - const CompositeModel &GetPlayerModel() const noexcept; + const Model &GetPlayerModel() const noexcept; bool ChunkInRange(const glm::ivec3 &) const noexcept; @@ -83,12 +83,15 @@ private: void On(const Packet::Login &) override; void On(const Packet::Part &) override; void On(const Packet::PlayerUpdate &) override; + void On(const Packet::Message &) override; bool CanSpawn(const Entity &) const noexcept; bool CanDespawn(const Entity &) const noexcept; void SendSpawn(SpawnStatus &); void SendDespawn(SpawnStatus &); + /// true if updates are pushed to the client this frame + bool SendingUpdates() const noexcept; void QueueUpdate(SpawnStatus &); void SendUpdates(); @@ -100,15 +103,16 @@ private: Server &server; Connection conn; std::unique_ptr input; - const CompositeModel *player_model; + const Model *player_model; std::list spawns; unsigned int confirm_wait; std::vector entity_updates; + unsigned int entity_updates_skipped; EntityState player_update_state; std::uint16_t player_update_pack; - IntervalTimer player_update_timer; + CoarseTimer player_update_timer; std::uint8_t old_actions; ChunkTransmitter transmitter;