@ -95,8 +95,8 @@ static CTcpSock CrashCounterSock;
void quitCrashReport ( )
void quitCrashReport ( )
{
{
if ( NLMISC : : CFile : : fileExists ( " ryzom_started " ) )
if ( NLMISC : : CFile : : fileExists ( getLogDirectory ( ) + " ryzom_started " ) )
CFile : : deleteFile ( " ryzom_started " ) ;
CFile : : deleteFile ( getLogDirectory ( ) + " ryzom_started " ) ;
// must disconnect now, else could crash at dtor time because nldebug -> access a new INelContext()
// must disconnect now, else could crash at dtor time because nldebug -> access a new INelContext()
contReset ( CrashCounterSock ) ;
contReset ( CrashCounterSock ) ;
}
}
@ -285,7 +285,7 @@ INT_PTR CALLBACK ReportDialogProc(
void initCrashReport ( )
void initCrashReport ( )
{
{
//
//
bool crashed = CFile : : isExists ( " ryzom_started " ) ;
bool crashed = CFile : : isExists ( getLogDirectory ( ) + " ryzom_started " ) ;
bool during_release = false ;
bool during_release = false ;
bool exception_catched = false ;
bool exception_catched = false ;
bool breakpointed = false ;
bool breakpointed = false ;
@ -293,22 +293,21 @@ void initCrashReport ()
bool report_failed = false ;
bool report_failed = false ;
bool report_refused = false ;
bool report_refused = false ;
bool report_sent = false ;
bool report_sent = false ;
if ( crashed & & CFile : : isExists ( " during_release " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " during_release " ) )
during_release = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " during_release " ) ;
during_release = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " during_release " ) ;
if ( crashed & & CFile : : isExists ( " exception_catched " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " exception_catched " ) )
exception_catched = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " exception_catched " ) ;
exception_catched = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " exception_catched " ) ;
if ( crashed & & CFile : : isExists ( " breakpointed " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " breakpointed " ) )
breakpointed = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " breakpointed " ) ;
breakpointed = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " breakpointed " ) ;
if ( crashed & & CFile : : isExists ( " nel_debug.dmp " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " nel_debug.dmp " ) )
dumped = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " nel_debug.dmp " ) ;
dumped = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " nel_debug.dmp " ) ;
if ( crashed & & CFile : : isExists ( " report_failed " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " report_failed " ) )
report_failed = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " report_failed " ) ;
report_failed = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " report_failed " ) ;
if ( crashed & & CFile : : isExists ( " report_refused " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " report_refused " ) )
report_refused = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " report_refused " ) ;
report_refused = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " report_refused " ) ;
if ( crashed & & CFile : : isExists ( " report_sent " ) )
if ( crashed & & CFile : : isExists ( getLogDirectory ( ) + " report_sent " ) )
report_sent = CFile : : getFileModificationDate ( " ryzom_started " ) < = CFile : : getFileModificationDate ( " report_sent " ) ;
report_sent = CFile : : getFileModificationDate ( getLogDirectory ( ) + " ryzom_started " ) < = CFile : : getFileModificationDate ( getLogDirectory ( ) + " report_sent " ) ;
FILE * file = fopen ( " ryzom_started " , " wb " ) ;
CFile : : createEmptyFile ( getLogDirectory ( ) + " ryzom_started " ) ;
fclose ( file ) ;
connect ( ) ;
connect ( ) ;
if ( report_sent )
if ( report_sent )
send ( " /?crashtype=REPORT_SENT " ) ;
send ( " /?crashtype=REPORT_SENT " ) ;
@ -580,8 +579,7 @@ int main(int argc, char **argv)
//ICommand::execute("iFileAccessLogClear",*NLMISC::InfoLog);
//ICommand::execute("iFileAccessLogClear",*NLMISC::InfoLog);
# endif
# endif
FILE * file = fopen ( " during_release " , " wb " ) ;
CFile : : createEmptyFile ( getLogDirectory ( ) + " during_release " ) ;
fclose ( file ) ;
# ifdef TEST_CRASH_COUNTER
# ifdef TEST_CRASH_COUNTER
if ( string ( cmdline ) = = " /release " )
if ( string ( cmdline ) = = " /release " )