diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 0a5f4c80..3ea903c3 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -2412,19 +2412,15 @@ void mainWindowImpl::networkError(int errorID, int osErrorID) { tr("Internal network error: \"select\" failed."), QMessageBox::Close); } break; - case ERR_SOCK_RECV_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"recv\" failed."), - QMessageBox::Close); } - break; case ERR_SOCK_SEND_FAILED: { QMessageBox::warning(this, tr("Network Error"), tr("Internal network error: \"send\" failed."), QMessageBox::Close); } break; + case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close. case ERR_SOCK_CONN_RESET: { QMessageBox::warning(this, tr("Network Error"), - tr("Connection was closed by server."), + tr("Connection was closed by the server."), QMessageBox::Close); } break; case ERR_SOCK_CONN_EXISTS: diff --git a/src/net/clientcontext.h b/src/net/clientcontext.h index bfe1eaa4..762f77cf 100644 --- a/src/net/clientcontext.h +++ b/src/net/clientcontext.h @@ -70,7 +70,7 @@ private: unsigned m_serverPort; std::string m_password; sockaddr_storage m_clientSockaddr; - std::string m_playerName; // TODO: use player interface. + std::string m_playerName; }; #endif diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 67c0fc9d..c8cf1f3c 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -497,7 +497,7 @@ ClientStateWaitGame::InternalProcess(ClientThread &client, boost::shared_ptrToNetPacketPlayerLeft()->GetData(netPlayerData); client.RemovePlayerData(netPlayerData.playerId); } - // TODO: handle error packet + // TODO: handle error packet (kicked from server) return retVal; } diff --git a/src/net/common/clientthread.cpp b/src/net/common/clientthread.cpp index 44ad8e62..332a62de 100644 --- a/src/net/common/clientthread.cpp +++ b/src/net/common/clientthread.cpp @@ -157,6 +157,9 @@ ClientThread::Main() MapPlayerDataList(); m_game.reset(new Game(&m_gui, factory, GetPlayerDataList(), GetGameData(), GetStartData(), m_curGameId++)); + // Initialize GUI speed. + GetGui().initGui(GetGameData().guiSpeed); + // Signal start of game to GUI. GetCallback().SignalNetClientGameStart(m_game); } } diff --git a/src/session.cpp b/src/session.cpp index e86d6730..1e55e64c 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -68,7 +68,6 @@ void Session::startLocalGame(const GameData &gameData, const StartData &startDat else { myAvatar << "Opponent" << i << "Avatar"; } //PlayerData erzeugen - // TODO: PlayerType setzen // UniqueId = PlayerNumber for local games. boost::shared_ptr playerData(new PlayerData(i, i, i == 0 ? PLAYER_TYPE_HUMAN : PLAYER_TYPE_COMPUTER)); playerData->SetName(myConfig->readConfigString(myName.str())); @@ -91,8 +90,6 @@ void Session::startClientGame(boost::shared_ptr game) { currentGameID++; -// TODO: use server gui speed. - myGui->initGui(5); currentGame = game; } @@ -109,7 +106,10 @@ GuiInterface *Session::getGui() void Session::startNetworkClient(const string &serverAddress, unsigned serverPort, bool ipv6, const string &pwd) { if (myNetClient || !myGui) - return; // TODO: throw exception + { + assert(false); + return; + } myNetClient = new ClientThread(*myGui); myNetClient->Init( serverAddress, @@ -123,7 +123,10 @@ void Session::startNetworkClient(const string &serverAddress, unsigned serverPor void Session::startNetworkClientForLocalServer() { if (myNetClient || !myGui) - return; // TODO: throw exception + { + assert(false); + return; + } myNetClient = new ClientThread(*myGui); myNetClient->Init( "localhost", @@ -151,7 +154,10 @@ void Session::terminateNetworkClient() void Session::startNetworkServer(const GameData &gameData) { if (myNetServer) - return; // TODO: throw exception + { + assert(false); + return; + } myNetServer = new ServerThread(*myGui, myConfig); myNetServer->Init( myConfig->readConfigInt("ServerPort"), @@ -164,7 +170,10 @@ void Session::startNetworkServer(const GameData &gameData) void Session::initiateNetworkServerGame() { if (!myNetServer) - return; // TODO: throw exception + { + assert(false); + return; + } myNetServer->StartGame(); }