diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/game.cpp | 13 | ||||
-rw-r--r-- | src/gui/updatewindow.cpp | 15 |
3 files changed, 29 insertions, 7 deletions
@@ -1,4 +1,10 @@ -2007-12-21 Bjørn Lindeijer <bjorn@lindeijer.nl> +2007-12-21 David Athay <ko2fan@gmail.com> + + * src/game.cpp, src/gui/updatewindow.cpp: Attempted to fix client + freeze when unable to connect to update host, and added exit dialog + when client loses connection. + +2007-12-21 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/shoplistbox.cpp: Fixed shop list box not to scroll up when the selection is removed. diff --git a/src/game.cpp b/src/game.cpp index 9a669661..df355e66 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -417,6 +417,19 @@ void Game::logic() // Handle network stuff mNetwork->flush(); mNetwork->dispatchMessages(); + + if (!mNetwork->isConnected()) + { + if (!exitConfirm) + { + exitConfirm = new + ConfirmDialog("Network Error", + "There was a network error, the program will now quit"); + exitConfirm->addActionListener(&exitListener); + } + + exitConfirm->requestMoveToTop(); + } } } diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 73dbd604..f115238d 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -307,17 +307,20 @@ int UpdaterWindow::downloadThread(void *ptr) switch (res) { case CURLE_COULDNT_CONNECT: - // give more debug info on that error - std::cerr << "curl error " << res << ": " - << uw->mCurlError << " " << url.c_str() - << std::endl; - break; - default: std::cerr << "curl error " << res << ": " << uw->mCurlError << " host: " << url.c_str() << std::endl; + break; + } + + if (!uw->mStoreInMemory) + { + fclose(outfile); + ::remove(outFilename.c_str()); } + attempts++; + continue; } curl_easy_cleanup(curl); |