Added packet loss logic for multiple clients.

Changed packet class to fit our needs.
This commit is contained in:
Jocke
2016-01-20 13:43:11 +01:00
parent 85523343b2
commit f52cddb445
6 changed files with 58 additions and 28 deletions
+3 -5
View File
@@ -43,16 +43,14 @@ private:
//Timers
std::clock_t m_StartPingTime;
std::clock_t m_StopTimes[8];
// Game logic
World* m_World;
EventBroker* m_EventBroker;
// Packet loss logic
unsigned int m_PacketID;
unsigned int m_PreviousPacketID;
unsigned int m_SendPacketID;
unsigned int m_PacketID = 0;
unsigned int m_PreviousPacketID = 0;
// Private member functions
int receive(char* data, size_t length);
@@ -73,8 +71,8 @@ private:
void parseServerPing();
void identifyPacketLoss();
EntityID createPlayer();
int GetPlayerIDFromEndpoint(boost::asio::ip::udp::endpoint endpoint);
// Debug event
EventRelay<Server, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand& e);
};