diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
| commit | e4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch) | |
| tree | ed58c3c246e3af1af337697695d780aa31f6ad9a /src/server/client.hh | |
| parent | 1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff) | |
Update to most recent version (old initial commit)
Diffstat (limited to 'src/server/client.hh')
| -rw-r--r-- | src/server/client.hh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/client.hh b/src/server/client.hh index 5866035..4a2c1fd 100644 --- a/src/server/client.hh +++ b/src/server/client.hh @@ -9,10 +9,10 @@ #include <unordered_set> #include "server/chunk_data.hh" -#include "server/world.hh" +#include "server/world/chunk.hh" +#include "shared/entity/player.hh" #include "shared/net/connection.hh" -#include "shared/player.hh" -#include "shared/world.hh" +#include "shared/world/chunk.hh" namespace server { @@ -44,14 +44,21 @@ public: decltype(&shared::world::chunk::equal)> chunks{4096, shared::world::chunk::hash, shared::world::chunk::equal}; + // sequence of the client's last commands, used for prediction + shared::tick_t sequence = 0u; + public: client(shared::net::connection&& con, const shared::player::index_t& index) : connection(std::move(con)), index(index) {} + bool is_in_pvs(const client& other) const noexcept; + + // Not safe to use getter functions without checking has_initalised. bool has_initialised() const noexcept { return this->player_info.has_value(); } - shared::player& get_player() noexcept { + + shared::player& get_player() const noexcept { return (*this->player_info)->player; } const std::string& get_username() const noexcept { |
