X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=57a34e49339a965655a170758a82603558bc6155;hb=63e9bcbd2db058858777f5db96f24f02548115c7;hp=0a5dcd034db106e0b868ae8fe82b9a9505636a5d;hpb=150d065f431d665326fd8028748c48a74ad956bb;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index 0a5dcd0..57a34e4 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 &); @@ -83,13 +83,17 @@ private: void On(const Packet::Login &) override; void On(const Packet::Part &) override; void On(const Packet::PlayerUpdate &) override; + void On(const Packet::ChunkBegin &) 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,6 +110,7 @@ private: unsigned int confirm_wait; std::vector entity_updates; + unsigned int entity_updates_skipped; EntityState player_update_state; std::uint16_t player_update_pack; @@ -115,6 +120,7 @@ private: ChunkTransmitter transmitter; std::deque chunk_queue; glm::ivec3 old_base; + unsigned int chunk_blocks_skipped; };