Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv20608
Modified Files:
console_win.cpp persistentbroker.cpp wolf.dsp wolfpack.cpp
Log Message:
Made it easier to read the Shutdown Message.
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** console_win.cpp 9 Sep 2003 23:09:30 -0000 1.7
--- console_win.cpp 13 Sep 2003 15:37:06 -0000 1.8
***************
*** 63,66 ****
--- 63,67 ----
unsigned int inputHeight = 0; // For measuring the height of the input field
unsigned int logLimit = 0; // How many characters fit into the log window
+ bool canClose = false;
/*
***************
*** 206,209 ****
--- 207,214 ----
case WM_CLOSE:
keeprun = 0;
+
+ if( canClose )
+ DestroyWindow( mainWindow );
+
return 1;
***************
*** 283,289 ****
argv[argc] = 0;
! returnValue_ = main( argc, argv.data() );
! PostMessage( mainWindow, WM_QUIT, 0, 0 );
}
};
--- 288,302 ----
argv[argc] = 0;
! returnValue_ = main( argc, argv.data() );
! if( returnValue_ != 0 )
! {
! Console::instance()->send( "\nThe server has been shut down. You can close this window now.\n" );
! canClose = true;
! }
! else
! {
! PostMessage( mainWindow, WM_QUIT, 0, 0 );
! }
}
};
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** persistentbroker.cpp 12 Sep 2003 20:02:44 -0000 1.28
--- persistentbroker.cpp 13 Sep 2003 15:37:06 -0000 1.29
***************
*** 71,76 ****
sqlite = false;
#else
! Log::instance()->print( LOG_ERROR, "Sorry, you have to define MYSQL_DRIVER to make wolfpack work with MySQL.\n" );
! exit( -1 );
#endif
}
--- 71,75 ----
sqlite = false;
#else
! throw QString( "Sorry, you have to define MYSQL_DRIVER to make wolfpack work with MySQL.\n" );
#endif
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.230
retrieving revision 1.231
diff -C2 -d -r1.230 -r1.231
*** wolf.dsp 12 Sep 2003 20:02:44 -0000 1.230
--- wolf.dsp 13 Sep 2003 15:37:06 -0000 1.231
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob1 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.465
retrieving revision 1.466
diff -C2 -d -r1.465 -r1.466
*** wolfpack.cpp 12 Sep 2003 15:29:00 -0000 1.465
--- wolfpack.cpp 13 Sep 2003 15:37:06 -0000 1.466
***************
*** 164,168 ****
}
! static void parseParameter( const QString ¶m )
{
// Add what ever paramters you want
--- 164,168 ----
}
! static bool parseParameter( const QString ¶m )
{
// Add what ever paramters you want
***************
*** 201,205 ****
PyErr_Print();
fprintf(stderr,"Call failed\n");
! return;
}
/* pDict and pFunc are borrowed and must not be Py_DECREF-ed */
--- 201,205 ----
PyErr_Print();
fprintf(stderr,"Call failed\n");
! return false;
}
/* pDict and pFunc are borrowed and must not be Py_DECREF-ed */
***************
*** 216,225 ****
}
stopPython();
! exit(0);
}
else
Console::instance()->send( QString("The specified python script [%1] doesn't exist.").arg(param) );
-
}
}
--- 216,226 ----
}
stopPython();
! return false;
}
else
Console::instance()->send( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
+
+ return true;
}
***************
*** 331,335 ****
{
Console::instance()->log( LOG_ERROR, "Couldn't start up classes.\n" );
! exit( -1 );
}
--- 332,336 ----
{
Console::instance()->log( LOG_ERROR, "Couldn't start up classes.\n" );
! return 1;
}
***************
*** 347,351 ****
{
Console::instance()->log( LOG_ERROR, "Couldn't load translator.\n" );
! exit( -1 );
}
--- 348,352 ----
{
Console::instance()->log( LOG_ERROR, "Couldn't load translator.\n" );
! return 1;
}
***************
*** 358,362 ****
{
Console::instance()->log( LOG_ERROR, "Couldn't start up python.\n" );
! exit( -1 );
}
--- 359,363 ----
{
Console::instance()->log( LOG_ERROR, "Couldn't start up python.\n" );
! return 1;
}
***************
*** 364,368 ****
for( i = 1; i <= argc; ++i )
! parseParameter( QString( argv[ i ] ) );
// Load data
--- 365,370 ----
for( i = 1; i <= argc; ++i )
! if( !parseParameter( QString( argv[ i ] ) ) )
! return 1;
// Load data
***************
*** 423,432 ****
{
Console::instance()->log( LOG_ERROR, exception.error() );
! exit( -1 );
}
catch( ... )
{
Console::instance()->log( LOG_ERROR, "Unknown error while loading data files.\n" );
! exit( -1 );
}
--- 425,434 ----
{
Console::instance()->log( LOG_ERROR, exception.error() );
! return 1;
}
catch( ... )
{
Console::instance()->log( LOG_ERROR, "Unknown error while loading data files.\n" );
! return 1;
}
***************
*** 485,494 ****
{
Console::instance()->log( LOG_ERROR, error );
! exit( -1 );
}
catch( ... )
{
Console::instance()->log( LOG_ERROR, "An unknown error occured while loading the world.\n" );
! exit( -1 );
}
--- 487,496 ----
{
Console::instance()->log( LOG_ERROR, error );
! return 1;
}
catch( ... )
{
Console::instance()->log( LOG_ERROR, "An unknown error occured while loading the world.\n" );
! return 1;
}
|