Client now responds to deleted entity and component in server

This commit is contained in:
stiffly
2016-01-24 17:15:26 +01:00
parent 67477ff3ae
commit 2eaad2aa00
6 changed files with 83 additions and 4 deletions
+3
View File
@@ -79,6 +79,8 @@ private:
void parsePing();
void parseKick();
void parsePlayersSpawned(Packet& packet);
void parseEntityDeletion(Packet& packet);
void parseComponentDeletion(Packet& packet);
void InterpolateFields(Packet & packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
void parseSnapshot(Packet& packet);
void identifyPacketLoss();
@@ -92,6 +94,7 @@ private:
// Returns if server EntityID exist in map
bool serverClientMapsHasEntity(EntityID serverEntityID);
void insertIntoServerClientMaps(EntityID serverEntityID, EntityID clientEntityID);
void deleteFromServerClientMaps(EntityID serverEntityID, EntityID clientEntityID);
// Events
EventBroker* m_EventBroker;
+3 -1
View File
@@ -15,7 +15,9 @@ enum class MessageType
PlayerConnected,
BecomePlayer,
Kick,
OnPlayerSpawned
OnPlayerSpawned,
EntityDeleted,
ComponentDeleted
};
#endif
+6
View File
@@ -16,6 +16,8 @@
#include "Core/EPlayerDamage.h"
#include "Network/EPlayerDisconnected.h"
#include "Core/EPlayerSpawned.h"
#include "Core/EEntityDeleted.h"
#include "Core/EComponentDeleted.h"
class Server : public Network
{
@@ -83,6 +85,10 @@ private:
bool OnInputCommand(const Events::InputCommand& e);
EventRelay<Server, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
EventRelay<Server, Events::EntityDeleted> m_EEntityDeleted;
bool OnEntityDeleted(const Events::EntityDeleted& e);
EventRelay<Server, Events::ComponentDeleted> m_EComponentDeleted;
bool OnComponentDeleted(const Events::ComponentDeleted& e);
};
#endif