feat(network): integrate protobuf for player sync and session management

Add Protobuf dependency, define proto messages for player requests, positions, and chunk data. Refactor Session to use strand and async write. Implement player join/exit and position sync in ServerWorld.
This commit is contained in:
2026-06-23 20:08:40 +08:00
parent 1acfeef9e6
commit 4303c1cd32
12 changed files with 236 additions and 28 deletions

View File

@@ -0,0 +1,10 @@
#include "Cubed/gameplay/server_player.hpp"
namespace Cubed {
ServerPlayer::ServerPlayer(std::string_view name) : m_name(name) {}
const glm::vec3& ServerPlayer::get_pos() const { return m_pos; }
const std::string& ServerPlayer::get_name() const { return m_name; }
void ServerPlayer::update_pos(float x, float y, float z) {
m_pos = glm::vec3{x, y, z};
}
} // namespace Cubed