ProudNet provides the function that keeps recording error directory without shutting down the program in case of error in the program. This is called Pauseless error dump system (Exception Logger).
In case of crash at a general game server, program re-starts right after recording the error history (please refer to Tutorial for Error Dump System Construction) But in case it is absolutely necessary, the game server is kept operating without re-starting as error situation is maintained. You need to pay special attention because it is very dangerous for the server program whose memory has been damaged to be operated continuously.
1. Check list before creating pauseless error dump system.
- You need to install DbgHelp library (dbghelp.dll).
- You need to set C++ Exception compile option of Visual Studio (please refer to Compile Setting for Error Dump System).
- Include : DumpCommon.h, MiniDumper.h
- Link : ProudNetCommon.lib
2. Example of creating pauseless error dump system.
- You need to call CExceptionLogger::Instance().Init() function from Main Entry Point and initialize CExceptionLogger instance.
- You need to inherit IExceptionLoggerDelegate abstract class and override GetDumpDirectory() member, and then you must define dump file directory. In case of returning blank (""), dump files will be saved in the current folder.
Note
- It is operated at the version of Windows XP/ Windows 2003 Server or later.
- Performance of the program might become worse due to overload of log history in case of using CExceptionLogger class along with AtlTrace() or DebugOutputString().
#include "stdafx.h"
#include <atlpath.h>
#include "../../include/DumpCommon.h"
#include "../../include/MiniDumper.h"
using namespace Proud;
{
public:
virtual String GetDumpDirectory()
{
return L"";
}
};
CIExceptionLoggerDelegate g_loggerInfo;
void AccessViolation()
{
try
{
int* a = 0;
*a = 1;
}
catch (...)
{
}
}
void main(int argc, char* argv[])
{
int menu = 0;
CExceptionLogger::Instance().Init(&g_loggerInfo);
while (1)
{
puts("MENU: 1. Access Violation('a')");
printf("> ");
menu = getchar();
switch (menu)
{
case 'a':
AccessViolation();
break;
default:
break;
}
}
}
- Example of this source file is in <installation folder>\Sample\SimpleExceptionLogger.