mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
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.
18 lines
381 B
C++
18 lines
381 B
C++
#pragma once
|
|
#include <glm/glm.hpp>
|
|
#include <string>
|
|
#include <string_view>
|
|
namespace Cubed {
|
|
class ServerPlayer {
|
|
public:
|
|
explicit ServerPlayer(std::string_view);
|
|
const glm::vec3& get_pos() const;
|
|
const std::string& get_name() const;
|
|
void update_pos(float x, float y, float z);
|
|
|
|
private:
|
|
std::string m_name;
|
|
glm::vec3 m_pos{0.0f};
|
|
};
|
|
} // namespace Cubed
|