Fixed the bug where starting a server made the program crash on closing.
Fixed some memory leaks in Client.cpp.
This commit is contained in:
@@ -19,6 +19,7 @@ public:
|
||||
Server();
|
||||
~Server();
|
||||
void Start(World* m_world);
|
||||
void Close();
|
||||
|
||||
private:
|
||||
// udp stuff
|
||||
@@ -30,15 +31,16 @@ private:
|
||||
std::clock_t m_StartPingTime;
|
||||
std::clock_t m_StopTimes[8];
|
||||
// Game logic
|
||||
|
||||
World* m_World;
|
||||
|
||||
// Close logic
|
||||
bool m_ThreadIsRunning = true;
|
||||
// Threaded
|
||||
void DisplayLoop();
|
||||
void ReadFromClients();
|
||||
void InputLoop();
|
||||
|
||||
|
||||
|
||||
int Receive(char* data, size_t length);
|
||||
int CreateMessage(MessageType type, std::string message, char * data);
|
||||
void MoveMessageHead(char*& data, size_t& length, size_t stepSize);
|
||||
|
||||
Reference in New Issue
Block a user