Moved client and server from header.

Fixed so user are able to start a server and client on the same computer.
Starting 2 servers on the same computer will probably still crash the newest server (Don't do it).
This commit is contained in:
Jocke
2015-12-09 17:50:30 +01:00
parent 0807a7d0ae
commit 663aca2641
3 changed files with 18 additions and 9 deletions
+4 -2
View File
@@ -48,8 +48,8 @@ Game::Game(int argc, char* argv[])
Game::~Game()
{
// Call before to ensure that thread closes correctly.
m_Client.Close();
m_Server.Close();
//m_Client.Close();
//m_Server.Close();
delete m_FrameStack;
delete m_EventBroker;
@@ -84,9 +84,11 @@ void Game::NetworkFunction()
std::cout << "Start client or server? (c/s)" << std::endl;
std::cin >> inputMessage;
if (inputMessage == "c" || inputMessage == "C") {
Client m_Client;
m_Client.Start(m_World, m_EventBroker);
}
if (inputMessage == "s" || inputMessage == "S") {
Server m_Server;
m_Server.Start(m_World);
}
}