implement server and client player join/leave notifications

This commit is contained in:
2024-07-22 12:58:40 +02:00
parent cbb2f5005e
commit 392eaeab83
23 changed files with 422 additions and 25 deletions

View File

@@ -0,0 +1,9 @@
#pragma once
#include <cstdint>
namespace blitz {
using EntityID = std::uint32_t;
} // namespace blitz

View File

@@ -0,0 +1,13 @@
#pragma once
#include <blitz/common/Types.h>
#include <string>
namespace blitz {
struct PlayerInfoComponent {
EntityID m_PlayerId;
std::string m_Pseudo;
};
} // namespace blitz

View File

@@ -1,6 +1,7 @@
#pragma once
#include <string>
#include <blitz/components/PlayerInfo.h>
#include <vector>
namespace blitz {
namespace protocol {
@@ -14,17 +15,25 @@ struct UpdateHealth {
float m_NewHealth;
};
struct LoggingSuccess {};
struct LoggingSuccess {
EntityID m_PlayerId;
};
struct PlayerDeath {};
struct PlayerJoin {};
struct PlayerJoin {
PlayerInfoComponent m_Player;
};
struct PlayerLeave {};
struct PlayerLeave {
EntityID m_PlayerId;
};
struct PlayerStats {};
struct PlayerList {};
struct PlayerList {
std::vector<PlayerInfoComponent> m_Players;
};
struct ServerConfig {};