Client now has authority over its own absolute position and orientation until we have reliable input messaging

This commit is contained in:
2016-01-24 19:00:50 +01:00
parent 9f3d887ac4
commit 0fb1dbcae1
5 changed files with 61 additions and 3 deletions
+5 -1
View File
@@ -50,6 +50,7 @@ private:
PlayerID m_PlayerID = -1;
EntityID m_ServerEntityID = std::numeric_limits<EntityID>::max();
bool m_IsConnected = false;
EntityWrapper m_LocalPlayer = EntityWrapper::Invalid;
// Server Client Lookup map
// Assumes that root node for client and server is EntityID 0.
@@ -87,6 +88,7 @@ private:
bool hasServerTimedOut();
EntityID createPlayer();
void sendInputCommands();
void sendLocalPlayerTransform();
void becomePlayer();
// Mapping Logic
// Returns if local EntityID exist in map
@@ -100,8 +102,10 @@ private:
EventBroker* m_EventBroker;
EventRelay<Client, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand& e);
EventRelay<Client, Events::PlayerDamage> m_EPlayeDamage;
EventRelay<Client, Events::PlayerDamage> m_EPlayerDamage;
bool OnPlayerDamage(const Events::PlayerDamage& e);
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
};
#endif