[wpdev-commits] wolfpack server.cpp,1.24,1.25 world.cpp,1.127,1.128
Brought to you by:
rip,
thiagocorrea
From: Correa <thi...@us...> - 2004-09-19 16:51:22
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15643 Modified Files: server.cpp world.cpp Log Message: - Fix crash under windows when the server terminates unexpectedly - Exceptions should always be caught by reference. Index: world.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** world.cpp 14 Sep 2004 18:05:15 -0000 1.127 --- world.cpp 19 Sep 2004 16:50:41 -0000 1.128 *************** *** 451,455 **** object->load( reader ); objects.append(object); ! } catch (wpException e) { Console::instance()->log( LOG_WARNING, e.error() + "\n" ); } --- 451,455 ---- object->load( reader ); objects.append(object); ! } catch (wpException& e) { Console::instance()->log( LOG_WARNING, e.error() + "\n" ); } *************** *** 501,505 **** guild->load(reader, reader.version()); Guilds::instance()->registerGuild(guild); ! } catch (wpException e) { delete guild; } --- 501,505 ---- guild->load(reader, reader.version()); Guilds::instance()->registerGuild(guild); ! } catch (wpException& e) { delete guild; } Index: server.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** server.cpp 19 Sep 2004 16:25:36 -0000 1.24 --- server.cpp 19 Sep 2004 16:50:41 -0000 1.25 *************** *** 160,166 **** d->actionMutex.unlock(); ! try { action->execute(); ! } catch ( wpException e ) { Console::instance()->log( LOG_PYTHON, e.error() + "\n" ); } --- 160,169 ---- d->actionMutex.unlock(); ! try ! { action->execute(); ! } ! catch ( wpException& e ) ! { Console::instance()->log( LOG_PYTHON, e.error() + "\n" ); } *************** *** 256,260 **** setState( STARTUP ); ! QApplication app( argc, argv, false ); QTranslator translator( 0 ); --- 259,263 ---- setState( STARTUP ); ! new QApplication ( argc, argv, false ); QTranslator translator( 0 ); *************** *** 264,272 **** { Console::instance()->log( LOG_WARNING, "Your configuration file [wolfpack.xml] have just been created with default settings.\n"); ! #if !defined(Q_OS_WIN32) ! // We can only detect mul path under Windows. ! Console::instance()->log( LOG_ERROR, "Please setup the path to the *.mul files before continuing\n"); ! return false; ! #endif } --- 267,271 ---- { Console::instance()->log( LOG_WARNING, "Your configuration file [wolfpack.xml] have just been created with default settings.\n"); ! Console::instance()->log( LOG_WARNING, "You might have to change it accordingly before running again\n"); } *************** *** 280,291 **** setupConsole(); - // Load all subcomponents - try { - load(); - } catch(wpException &e) { - Console::instance()->log(LOG_ERROR, e.error() + "\n"); - return false; - } - // Start the QT translator QString languageFile = Config::instance()->getString( "General", "Language File", "", true ); --- 279,282 ---- *************** *** 300,303 **** --- 291,306 ---- } + // Load all subcomponents + try + { + load(); + } + catch(wpException &e) + { + Console::instance()->log(LOG_ERROR, e.error() + "\n"); + return false; + } + + try { // Open the Worldsave and Account Database drivers. *************** *** 375,379 **** Console::instance()->poll(); } ! catch ( wpException e ) { Console::instance()->log( LOG_PYTHON, e.error() + "\n" ); --- 378,382 ---- Console::instance()->poll(); } ! catch ( wpException& e ) { Console::instance()->log( LOG_PYTHON, e.error() + "\n" ); |