// *************************************************************** // Function: Shutdown.cpp // *************************************************************** #include "Main.h" #include "LocalData.h" #include "GameServerData.h" void Icc_CleanUp(); //************************************ // Name: Shutdown // // Shuts down the server. Cleans up all allocations before terminating. // // Parameters: // // Return: // 0 //************************************ int Shutdown() { gDatabase.Update(); gCoreLog.WriteCategory("[Shutdown Initiated!]"); gCoreLog.Section("Login server shutting down..."); if (gpLoginServer!=NULL) { gpLoginServer->Shutdown(true); delete gpLoginServer; } gCoreLog.SectionOk(); gCoreLog.Section("Internal Communications Server shutting down..."); if (gpInternalComm!=NULL) { gpInternalComm->Shutdown(true); delete gpInternalComm; } gCoreLog.SectionOk(); if (gLoginInfo.size()>0) { gLoginInfo.clear(); } if (gGameServers.size()>0){gGameServers.clear();} Icc_CleanUp(); gCoreLog.Close(); gShutdownOK=true; return 0; }