implement server and client player join/leave notifications
This commit is contained in:
@@ -8,6 +8,10 @@ namespace server {
|
||||
|
||||
class Server {
|
||||
public:
|
||||
/**
|
||||
* \brief Construct a server
|
||||
* \pre Two instances of Server should not share the same world
|
||||
*/
|
||||
Server(std::uint16_t a_Port, std::shared_ptr<Nz::EnttWorld> a_World);
|
||||
~Server();
|
||||
|
||||
|
||||
13
include/server/components/ServerIdCounter.h
Normal file
13
include/server/components/ServerIdCounter.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <blitz/common/Types.h>
|
||||
|
||||
namespace blitz {
|
||||
namespace server {
|
||||
|
||||
struct ServerIdCounterComponent {
|
||||
EntityID m_NextEntityId;
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace blitz
|
||||
20
include/server/handlers/PlayerLoginHandler.h
Normal file
20
include/server/handlers/PlayerLoginHandler.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <blitz/protocol/PacketHandler.h>
|
||||
|
||||
namespace blitz {
|
||||
namespace server {
|
||||
|
||||
class PlayerLoginHandler : public protocol::PacketHandler {
|
||||
public:
|
||||
PlayerLoginHandler(network::EnetConnection& a_Connection, EnttWorld& a_World);
|
||||
~PlayerLoginHandler();
|
||||
|
||||
NazaraSlot(network::EnetConnection, OnPlayerLogin, m_Slot);
|
||||
|
||||
private:
|
||||
void Handle(std::uint16_t, const protocol::data::PlayerLogin&);
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace blitz
|
||||
Reference in New Issue
Block a user