mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user