Fixed bug where closing glwindow as client crashed.

Server bug is still present.
This commit is contained in:
Jocke
2015-12-09 13:37:02 +01:00
parent f83e217638
commit 0e6353dd79
4 changed files with 49 additions and 41 deletions
+3 -2
View File
@@ -23,7 +23,6 @@ public:
~Client();
void Start(World* world, EventBroker* eventBroker);
void Close();
private:
// Threaded
void ReadFromServer();
@@ -50,12 +49,14 @@ private:
World* m_World;
int m_PlayerID = -1;
glm::vec2 m_PlayerPositions[MAXCONNECTIONS];
//std::string m_PlayerNames[MAXCONNECTIONS];
PlayerDefinition m_PlayerDefinitions[MAXCONNECTIONS];
std::clock_t m_StartPingTime;
double m_DurationOfPingTime;
std::string m_PlayerName;
bool m_ThreadIsRunning = true;
// Use to check if we should send disconnect message
// if game is turned of by closing window.
bool m_WasStarted = false;
// Events
EventBroker* m_EventBroker;