aboutsummaryrefslogtreecommitdiff
path: root/src/server/client.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/client.hh')
-rw-r--r--src/server/client.hh15
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 {