• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature [TFS 1.x] Automatic save on exit

Fir3element

Active Member
Joined
Dec 31, 2015
Messages
28
Reaction score
46
game.cpp, search for:
Code:
void Game::shutdown()
{
   std::cout << "Shutting down..." << std::flush;

   g_scheduler.shutdown();
   g_databaseTasks.shutdown();
   g_dispatcher.shutdown();
   map.spawns.clear();
   raids.clear();

   cleanup();

   if (serviceManager) {
     serviceManager->stop();
   }

   ConnectionManager::getInstance().closeAll();

   std::cout << " done!" << std::endl;
}

replace for:
Code:
void Game::shutdown()
{
   std::cout << ">> Shutting down...\n> " << std::flush;

   saveGameState();
   g_scheduler.shutdown();
   g_databaseTasks.shutdown();
   g_dispatcher.shutdown();
   map.spawns.clear();
   raids.clear();

   cleanup();

   if (serviceManager) {
     serviceManager->stop();
   }

   ConnectionManager::getInstance().closeAll();

   std::cout << "> Done!" << std::endl;
}
 
Question. can i modify cpp files directly, or would i need to do this before compiling tfs?
 
Back
Top