X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=bd42241d9974897a8210afc3479e500c3e6e1c53;hb=56069d41c1553d87a8759713ef391d3a908adc0e;hp=1a781c5dd6ad5dea7f88b033e4648bed6aee4550;hpb=dbd214ac278019c20c883cbb76456b0b0fddc063;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index 1a781c5..bd42241 100644 --- a/src/server/ClientConnection.hpp +++ b/src/server/ClientConnection.hpp @@ -46,7 +46,7 @@ public: } /// send the previously prepared packet std::uint16_t Send(); - /// send the previously prepared packet of non-default length + /// send the previously prepared packet of given payload length std::uint16_t Send(std::size_t len); void AttachPlayer(Player &); @@ -85,11 +85,14 @@ private: void On(const Packet::PlayerUpdate &) override; void On(const Packet::Message &) override; + void CheckEntities(); bool CanSpawn(const Entity &) const noexcept; bool CanDespawn(const Entity &) const noexcept; void SendSpawn(SpawnStatus &); void SendDespawn(SpawnStatus &); + /// true if entity updates are pushed to the client this frame + bool SendingUpdates() const noexcept; void QueueUpdate(SpawnStatus &); void SendUpdates(); @@ -106,15 +109,17 @@ private: 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; std::deque chunk_queue; glm::ivec3 old_base; + unsigned int chunk_blocks_skipped; };