We are now sending EPlayerDamage events.
Client now listens to EPlayerDamage events and send them to Server. Server publishes EPlayerDamage events received from Client.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
#include "Input/EInputCommand.h"
|
||||
#include "Core/EPlayerDamage.h"
|
||||
|
||||
class Client : public Network
|
||||
{
|
||||
@@ -79,11 +80,13 @@ private:
|
||||
bool isConnected();
|
||||
EntityID createPlayer();
|
||||
bool hasMappedEntity(EntityID entityID);
|
||||
|
||||
// Events
|
||||
EventBroker* m_EventBroker;
|
||||
|
||||
EventRelay<Client, Events::InputCommand> m_EInputCommand;
|
||||
bool OnInputCommand(const Events::InputCommand& e);
|
||||
EventRelay<Client, Events::PlayerDamage> m_EPlayeDamage;
|
||||
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,8 @@ enum class MessageType
|
||||
Message,
|
||||
Snapshot,
|
||||
Event,
|
||||
OnInputCommand
|
||||
OnInputCommand,
|
||||
OnPlayerDamage
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Network/Network.h"
|
||||
#include "Input/EInputCommand.h"
|
||||
#include "Core/EPlayerDamage.h"
|
||||
|
||||
class Server : public Network
|
||||
{
|
||||
@@ -69,6 +70,7 @@ private:
|
||||
void disconnect(int i);
|
||||
void parseMessageType(Packet& packet);
|
||||
void parseOnInputCommand(Packet& packet);
|
||||
void parseOnPlayerDamage(Packet& packet);
|
||||
void parseConnect(Packet& packet);
|
||||
void parseDisconnect();
|
||||
void parseClientPing();
|
||||
|
||||
Reference in New Issue
Block a user