// *************************************************************** // Function: Restart.cpp // *************************************************************** #include "Main.h" int Shutdown(); //Clean-up the server //************************************ // Name: Restart // // Restarts the server. // // Parameters: // // Return: // //************************************ void Restart() { gCoreLog.warning("Game Server restarting..."); Shutdown(); #ifdef WIN32 //Start GW PROCESS_INFORMATION p; STARTUPINFO si; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory(&p, sizeof(p)); strcat(gCmdLine, " -restart"); char c[100]; strcpy(c, gCmdLine); if (CreateProcess(0, c, 0, 0, false, 0, 0, 0, &si, &p)==0) { gCoreLog.error("Failed to create process for restart!"); exit(-1); return; } ExitProcess(1); #endif exit(1); }