implement server and client player join/leave notifications
This commit is contained in:
9
include/blitz/common/Types.h
Normal file
9
include/blitz/common/Types.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace blitz {
|
||||
|
||||
using EntityID = std::uint32_t;
|
||||
|
||||
} // namespace blitz
|
||||
13
include/blitz/components/PlayerInfo.h
Normal file
13
include/blitz/components/PlayerInfo.h
Normal 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
|
||||
@@ -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 {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user