begin client-server

This commit is contained in:
2025-08-06 20:10:56 +02:00
parent 89213e9a97
commit c813c49707
26 changed files with 264 additions and 188 deletions

View File

@@ -9,10 +9,6 @@ namespace server {
class Server;
class IServerState : private utils::SlotGuard {
protected:
void SendPacket(PlayerID a_Id, const protocol::PacketBase& a_Packet);
void SetNewState(const std::shared_ptr<IServerState>& a_NewState);
public:
virtual void HandlePacket(PlayerID a_Id, const protocol::PacketBase& a_Packet) = 0;
virtual void Update(float a_Delta) = 0;
@@ -22,6 +18,12 @@ class IServerState : private utils::SlotGuard {
IServerState();
virtual ~IServerState();
protected:
void SendPacket(PlayerID a_Id, const protocol::PacketBase& a_Packet);
void BroadcastPacket(const protocol::PacketBase& a_Packet);
void SetNewState(const std::shared_ptr<IServerState>& a_NewState);
virtual void Init() {}
private:
Server* m_Server;