/src/server/worldserver/Main.cpp

https://gitlab.com/tkrokli/TrinityCore_434 · C++ · 564 lines · 389 code · 103 blank · 72 comment · 51 complexity · a075b664d0d0995bec1fa363f7a199a7 MD5 · raw file

  1. /*
  2. * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
  3. * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /// \addtogroup Trinityd Trinity Daemon
  19. /// @{
  20. /// \file
  21. #include "Common.h"
  22. #include "Commands.h"
  23. #include "ZmqContext.h"
  24. #include "DatabaseEnv.h"
  25. #include "AsyncAcceptor.h"
  26. #include "RASession.h"
  27. #include "Configuration/Config.h"
  28. #include "OpenSSLCrypto.h"
  29. #include "ProcessPriority.h"
  30. #include "BigNumber.h"
  31. #include "RealmList.h"
  32. #include "World.h"
  33. #include "MapManager.h"
  34. #include "InstanceSaveMgr.h"
  35. #include "ObjectAccessor.h"
  36. #include "ScriptMgr.h"
  37. #include "OutdoorPvP/OutdoorPvPMgr.h"
  38. #include "BattlegroundMgr.h"
  39. #include "TCSoap.h"
  40. #include "CliRunnable.h"
  41. #include "GitRevision.h"
  42. #include "WorldSocket.h"
  43. #include "WorldSocketMgr.h"
  44. #include "BattlenetServerManager.h"
  45. #include "DatabaseLoader.h"
  46. #include "AppenderDB.h"
  47. #include <openssl/opensslv.h>
  48. #include <openssl/crypto.h>
  49. #include <boost/asio/io_service.hpp>
  50. #include <boost/asio/deadline_timer.hpp>
  51. #include <boost/program_options.hpp>
  52. using namespace boost::program_options;
  53. #ifndef _TRINITY_CORE_CONFIG
  54. #define _TRINITY_CORE_CONFIG "worldserver.conf"
  55. #endif
  56. #define WORLD_SLEEP_CONST 50
  57. #ifdef _WIN32
  58. #include "ServiceWin32.h"
  59. char serviceName[] = "worldserver";
  60. char serviceLongName[] = "TrinityCore world service";
  61. char serviceDescription[] = "TrinityCore World of Warcraft emulator world service";
  62. /*
  63. * -1 - not in service mode
  64. * 0 - stopped
  65. * 1 - running
  66. * 2 - paused
  67. */
  68. int m_ServiceStatus = -1;
  69. #endif
  70. boost::asio::io_service _ioService;
  71. boost::asio::deadline_timer _freezeCheckTimer(_ioService);
  72. uint32 _worldLoopCounter(0);
  73. uint32 _lastChangeMsTime(0);
  74. uint32 _maxCoreStuckTimeInMs(0);
  75. WorldDatabaseWorkerPool WorldDatabase; ///< Accessor to the world database
  76. CharacterDatabaseWorkerPool CharacterDatabase; ///< Accessor to the character database
  77. LoginDatabaseWorkerPool LoginDatabase; ///< Accessor to the realm/login database
  78. Battlenet::RealmHandle realmHandle; ///< Id of the realm
  79. void SignalHandler(const boost::system::error_code& error, int signalNumber);
  80. void FreezeDetectorHandler(const boost::system::error_code& error);
  81. AsyncAcceptor* StartRaSocketAcceptor(boost::asio::io_service& ioService);
  82. bool StartDB();
  83. void StopDB();
  84. void WorldUpdateLoop();
  85. void ClearOnlineAccounts();
  86. void ShutdownCLIThread(std::thread* cliThread);
  87. void ShutdownThreadPool(std::vector<std::thread>& threadPool);
  88. variables_map GetConsoleArguments(int argc, char** argv, std::string& cfg_file, std::string& cfg_service);
  89. /// Launch the Trinity server
  90. extern int main(int argc, char** argv)
  91. {
  92. std::string configFile = _TRINITY_CORE_CONFIG;
  93. std::string configService;
  94. auto vm = GetConsoleArguments(argc, argv, configFile, configService);
  95. // exit if help or version is enabled
  96. if (vm.count("help") || vm.count("version"))
  97. return 0;
  98. #ifdef _WIN32
  99. if (configService.compare("install") == 0)
  100. return WinServiceInstall() == true ? 0 : 1;
  101. else if (configService.compare("uninstall") == 0)
  102. return WinServiceUninstall() == true ? 0 : 1;
  103. else if (configService.compare("run") == 0)
  104. WinServiceRun();
  105. #endif
  106. std::string configError;
  107. if (!sConfigMgr->LoadInitial(configFile, configError))
  108. {
  109. printf("Error in config file: %s\n", configError.c_str());
  110. return 1;
  111. }
  112. sLog->RegisterAppender<AppenderDB>();
  113. // If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
  114. sLog->Initialize(sConfigMgr->GetBoolDefault("Log.Async.Enable", false) ? &_ioService : nullptr);
  115. TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", GitRevision::GetFullVersion());
  116. TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n");
  117. TC_LOG_INFO("server.worldserver", " ______ __");
  118. TC_LOG_INFO("server.worldserver", "/\\__ _\\ __ __/\\ \\__");
  119. TC_LOG_INFO("server.worldserver", "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
  120. TC_LOG_INFO("server.worldserver", " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
  121. TC_LOG_INFO("server.worldserver", " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
  122. TC_LOG_INFO("server.worldserver", " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
  123. TC_LOG_INFO("server.worldserver", " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
  124. TC_LOG_INFO("server.worldserver", " C O R E /\\___/");
  125. TC_LOG_INFO("server.worldserver", "http://TrinityCore.org \\/__/\n");
  126. TC_LOG_INFO("server.worldserver", "Using configuration file %s.", configFile.c_str());
  127. TC_LOG_INFO("server.worldserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
  128. TC_LOG_INFO("server.worldserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
  129. OpenSSLCrypto::threadsSetup();
  130. // Seed the OpenSSL's PRNG here.
  131. // That way it won't auto-seed when calling BigNumber::SetRand and slow down the first world login
  132. BigNumber seed;
  133. seed.SetRand(16 * 8);
  134. /// worldserver PID file creation
  135. std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
  136. if (!pidFile.empty())
  137. {
  138. if (uint32 pid = CreatePIDFile(pidFile))
  139. TC_LOG_INFO("server.worldserver", "Daemon PID: %u\n", pid);
  140. else
  141. {
  142. TC_LOG_ERROR("server.worldserver", "Cannot create PID file %s.\n", pidFile.c_str());
  143. return 1;
  144. }
  145. }
  146. // Set signal handlers (this must be done before starting io_service threads, because otherwise they would unblock and exit)
  147. boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM);
  148. #if PLATFORM == PLATFORM_WINDOWS
  149. signals.add(SIGBREAK);
  150. #endif
  151. signals.async_wait(SignalHandler);
  152. // Start the Boost based thread pool
  153. int numThreads = sConfigMgr->GetIntDefault("ThreadPool", 1);
  154. std::vector<std::thread> threadPool;
  155. if (numThreads < 1)
  156. numThreads = 1;
  157. for (int i = 0; i < numThreads; ++i)
  158. threadPool.push_back(std::thread(boost::bind(&boost::asio::io_service::run, &_ioService)));
  159. // Set process priority according to configuration settings
  160. SetProcessPriority("server.worldserver");
  161. // Start the databases
  162. if (!StartDB())
  163. {
  164. ShutdownThreadPool(threadPool);
  165. return 1;
  166. }
  167. // Set server offline (not connectable)
  168. LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = (flag & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmHandle.Index);
  169. // Initialize the World
  170. sWorld->SetInitialWorldSettings();
  171. // Launch CliRunnable thread
  172. std::thread* cliThread = nullptr;
  173. #ifdef _WIN32
  174. if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
  175. #else
  176. if (sConfigMgr->GetBoolDefault("Console.Enable", true))
  177. #endif
  178. {
  179. cliThread = new std::thread(CliThread);
  180. }
  181. // Start the Remote Access port (acceptor) if enabled
  182. AsyncAcceptor* raAcceptor = nullptr;
  183. if (sConfigMgr->GetBoolDefault("Ra.Enable", false))
  184. raAcceptor = StartRaSocketAcceptor(_ioService);
  185. // Start soap serving thread if enabled
  186. std::thread* soapThread = nullptr;
  187. if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
  188. {
  189. soapThread = new std::thread(TCSoapThread, sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878)));
  190. }
  191. // Launch the worldserver listener socket
  192. uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
  193. std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
  194. sWorldSocketMgr.StartNetwork(_ioService, worldListener, worldPort);
  195. // Set server online (allow connecting now)
  196. LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmHandle.Index);
  197. // Start the freeze check callback cycle in 5 seconds (cycle itself is 1 sec)
  198. if (int coreStuckTime = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0))
  199. {
  200. _maxCoreStuckTimeInMs = coreStuckTime * 1000;
  201. _freezeCheckTimer.expires_from_now(boost::posix_time::seconds(5));
  202. _freezeCheckTimer.async_wait(FreezeDetectorHandler);
  203. TC_LOG_INFO("server.worldserver", "Starting up anti-freeze thread (%u seconds max stuck time)...", coreStuckTime);
  204. }
  205. sIpcContext->Initialize();
  206. TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon) ready...", GitRevision::GetFullVersion());
  207. sBattlenetServer.InitializeConnection();
  208. sScriptMgr->OnStartup();
  209. WorldUpdateLoop();
  210. // Shutdown starts here
  211. ShutdownThreadPool(threadPool);
  212. sScriptMgr->OnShutdown();
  213. sIpcContext->Close();
  214. sBattlenetServer.CloseConnection();
  215. sWorld->KickAll(); // save and kick all players
  216. sWorld->UpdateSessions(1); // real players unload required UpdateSessions call
  217. // unload battleground templates before different singletons destroyed
  218. sBattlegroundMgr->DeleteAllBattlegrounds();
  219. sWorldSocketMgr.StopNetwork();
  220. sInstanceSaveMgr->Unload();
  221. sMapMgr->UnloadAll(); // unload all grids (including locked in memory)
  222. sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world
  223. sScriptMgr->Unload();
  224. sOutdoorPvPMgr->Die();
  225. // set server offline
  226. LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmHandle.Index);
  227. // Clean up threads if any
  228. if (soapThread != nullptr)
  229. {
  230. soapThread->join();
  231. delete soapThread;
  232. }
  233. delete raAcceptor;
  234. ///- Clean database before leaving
  235. ClearOnlineAccounts();
  236. StopDB();
  237. TC_LOG_INFO("server.worldserver", "Halting process...");
  238. ShutdownCLIThread(cliThread);
  239. OpenSSLCrypto::threadsCleanup();
  240. // 0 - normal shutdown
  241. // 1 - shutdown at error
  242. // 2 - restart command used, this code can be used by restarter for restart Trinityd
  243. return World::GetExitCode();
  244. }
  245. void ShutdownCLIThread(std::thread* cliThread)
  246. {
  247. if (cliThread != nullptr)
  248. {
  249. #ifdef _WIN32
  250. // First try to cancel any I/O in the CLI thread
  251. if (!CancelSynchronousIo(cliThread->native_handle()))
  252. {
  253. // if CancelSynchronousIo() fails, print the error and try with old way
  254. DWORD errorCode = GetLastError();
  255. LPSTR errorBuffer;
  256. DWORD formatReturnCode = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
  257. nullptr, errorCode, 0, (LPTSTR)&errorBuffer, 0, nullptr);
  258. if (!formatReturnCode)
  259. errorBuffer = "Unknown error";
  260. TC_LOG_DEBUG("server.worldserver", "Error cancelling I/O of CliThread, error code %u, detail: %s",
  261. uint32(errorCode), errorBuffer);
  262. LocalFree(errorBuffer);
  263. // send keyboard input to safely unblock the CLI thread
  264. INPUT_RECORD b[4];
  265. HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
  266. b[0].EventType = KEY_EVENT;
  267. b[0].Event.KeyEvent.bKeyDown = TRUE;
  268. b[0].Event.KeyEvent.uChar.AsciiChar = 'X';
  269. b[0].Event.KeyEvent.wVirtualKeyCode = 'X';
  270. b[0].Event.KeyEvent.wRepeatCount = 1;
  271. b[1].EventType = KEY_EVENT;
  272. b[1].Event.KeyEvent.bKeyDown = FALSE;
  273. b[1].Event.KeyEvent.uChar.AsciiChar = 'X';
  274. b[1].Event.KeyEvent.wVirtualKeyCode = 'X';
  275. b[1].Event.KeyEvent.wRepeatCount = 1;
  276. b[2].EventType = KEY_EVENT;
  277. b[2].Event.KeyEvent.bKeyDown = TRUE;
  278. b[2].Event.KeyEvent.dwControlKeyState = 0;
  279. b[2].Event.KeyEvent.uChar.AsciiChar = '\r';
  280. b[2].Event.KeyEvent.wVirtualKeyCode = VK_RETURN;
  281. b[2].Event.KeyEvent.wRepeatCount = 1;
  282. b[2].Event.KeyEvent.wVirtualScanCode = 0x1c;
  283. b[3].EventType = KEY_EVENT;
  284. b[3].Event.KeyEvent.bKeyDown = FALSE;
  285. b[3].Event.KeyEvent.dwControlKeyState = 0;
  286. b[3].Event.KeyEvent.uChar.AsciiChar = '\r';
  287. b[3].Event.KeyEvent.wVirtualKeyCode = VK_RETURN;
  288. b[3].Event.KeyEvent.wVirtualScanCode = 0x1c;
  289. b[3].Event.KeyEvent.wRepeatCount = 1;
  290. DWORD numb;
  291. WriteConsoleInput(hStdIn, b, 4, &numb);
  292. }
  293. #endif
  294. cliThread->join();
  295. delete cliThread;
  296. }
  297. }
  298. void ShutdownThreadPool(std::vector<std::thread>& threadPool)
  299. {
  300. sScriptMgr->OnNetworkStop();
  301. _ioService.stop();
  302. for (auto& thread : threadPool)
  303. {
  304. thread.join();
  305. }
  306. }
  307. void WorldUpdateLoop()
  308. {
  309. uint32 realCurrTime = 0;
  310. uint32 realPrevTime = getMSTime();
  311. uint32 prevSleepTime = 0; // used for balanced full tick time length near WORLD_SLEEP_CONST
  312. ///- While we have not World::m_stopEvent, update the world
  313. while (!World::IsStopped())
  314. {
  315. ++World::m_worldLoopCounter;
  316. realCurrTime = getMSTime();
  317. uint32 diff = getMSTimeDiff(realPrevTime, realCurrTime);
  318. sWorld->Update(diff);
  319. realPrevTime = realCurrTime;
  320. // diff (D0) include time of previous sleep (d0) + tick time (t0)
  321. // we want that next d1 + t1 == WORLD_SLEEP_CONST
  322. // we can't know next t1 and then can use (t0 + d1) == WORLD_SLEEP_CONST requirement
  323. // d1 = WORLD_SLEEP_CONST - t0 = WORLD_SLEEP_CONST - (D0 - d0) = WORLD_SLEEP_CONST + d0 - D0
  324. if (diff <= WORLD_SLEEP_CONST + prevSleepTime)
  325. {
  326. prevSleepTime = WORLD_SLEEP_CONST + prevSleepTime - diff;
  327. std::this_thread::sleep_for(std::chrono::milliseconds(prevSleepTime));
  328. }
  329. else
  330. prevSleepTime = 0;
  331. #ifdef _WIN32
  332. if (m_ServiceStatus == 0)
  333. World::StopNow(SHUTDOWN_EXIT_CODE);
  334. while (m_ServiceStatus == 2)
  335. Sleep(1000);
  336. #endif
  337. }
  338. }
  339. void SignalHandler(const boost::system::error_code& error, int /*signalNumber*/)
  340. {
  341. if (!error)
  342. World::StopNow(SHUTDOWN_EXIT_CODE);
  343. }
  344. void FreezeDetectorHandler(const boost::system::error_code& error)
  345. {
  346. if (!error)
  347. {
  348. uint32 curtime = getMSTime();
  349. uint32 worldLoopCounter = World::m_worldLoopCounter;
  350. if (_worldLoopCounter != worldLoopCounter)
  351. {
  352. _lastChangeMsTime = curtime;
  353. _worldLoopCounter = worldLoopCounter;
  354. }
  355. // possible freeze
  356. else if (getMSTimeDiff(_lastChangeMsTime, curtime) > _maxCoreStuckTimeInMs)
  357. {
  358. TC_LOG_ERROR("server.worldserver", "World Thread hangs, kicking out server!");
  359. ASSERT(false);
  360. }
  361. _freezeCheckTimer.expires_from_now(boost::posix_time::seconds(1));
  362. _freezeCheckTimer.async_wait(FreezeDetectorHandler);
  363. }
  364. }
  365. AsyncAcceptor* StartRaSocketAcceptor(boost::asio::io_service& ioService)
  366. {
  367. uint16 raPort = uint16(sConfigMgr->GetIntDefault("Ra.Port", 3443));
  368. std::string raListener = sConfigMgr->GetStringDefault("Ra.IP", "0.0.0.0");
  369. AsyncAcceptor* acceptor = new AsyncAcceptor(ioService, raListener, raPort);
  370. acceptor->AsyncAccept<RASession>();
  371. return acceptor;
  372. }
  373. /// Initialize connection to the databases
  374. bool StartDB()
  375. {
  376. MySQL::Library_Init();
  377. // Load databases
  378. DatabaseLoader loader("server.worldserver", DatabaseLoader::DATABASE_NONE);
  379. loader
  380. .AddDatabase(WorldDatabase, "World")
  381. .AddDatabase(CharacterDatabase, "Character")
  382. .AddDatabase(LoginDatabase, "Login");
  383. if (!loader.Load())
  384. return false;
  385. ///- Get the realm Id from the configuration file
  386. realmHandle.Index = sConfigMgr->GetIntDefault("RealmID", 0);
  387. if (!realmHandle.Index)
  388. {
  389. TC_LOG_ERROR("server.worldserver", "Realm ID not defined in configuration file");
  390. return false;
  391. }
  392. QueryResult realmIdQuery = LoginDatabase.PQuery("SELECT `Region`,`Battlegroup` FROM `realmlist` WHERE `id`=%u", realmHandle.Index);
  393. if (!realmIdQuery)
  394. {
  395. TC_LOG_ERROR("server.worldserver", "Realm id %u not defined in realmlist table", realmHandle.Index);
  396. return false;
  397. }
  398. realmHandle.Region = (*realmIdQuery)[0].GetUInt8();
  399. realmHandle.Battlegroup = (*realmIdQuery)[1].GetUInt8();
  400. TC_LOG_INFO("server.worldserver", "Realm running as realm ID %u region %u battlegroup %u", realmHandle.Index, uint32(realmHandle.Region), uint32(realmHandle.Battlegroup));
  401. ///- Clean the database before starting
  402. ClearOnlineAccounts();
  403. ///- Insert version info into DB
  404. WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", GitRevision::GetFullVersion(), GitRevision::GetHash()); // One-time query
  405. sWorld->LoadDBVersion();
  406. TC_LOG_INFO("server.worldserver", "Using World DB: %s", sWorld->GetDBVersion());
  407. return true;
  408. }
  409. void StopDB()
  410. {
  411. CharacterDatabase.Close();
  412. WorldDatabase.Close();
  413. LoginDatabase.Close();
  414. MySQL::Library_End();
  415. }
  416. /// Clear 'online' status for all accounts with characters in this realm
  417. void ClearOnlineAccounts()
  418. {
  419. // Reset online status for all accounts with characters on the current realm
  420. LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realmHandle.Index);
  421. // Reset online status for all characters
  422. CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
  423. // Battleground instance ids reset at server restart
  424. CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instanceId = 0");
  425. }
  426. /// @}
  427. variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile, std::string& configService)
  428. {
  429. // Silences warning about configService not be used if the OS is not Windows
  430. (void)configService;
  431. options_description all("Allowed options");
  432. all.add_options()
  433. ("help,h", "print usage message")
  434. ("version,v", "print version build info")
  435. ("config,c", value<std::string>(&configFile)->default_value(_TRINITY_CORE_CONFIG), "use <arg> as configuration file")
  436. ;
  437. #ifdef _WIN32
  438. options_description win("Windows platform specific options");
  439. win.add_options()
  440. ("service,s", value<std::string>(&configService)->default_value(""), "Windows service options: [install | uninstall]")
  441. ;
  442. all.add(win);
  443. #endif
  444. variables_map vm;
  445. try
  446. {
  447. store(command_line_parser(argc, argv).options(all).allow_unregistered().run(), vm);
  448. notify(vm);
  449. }
  450. catch (std::exception& e) {
  451. std::cerr << e.what() << "\n";
  452. }
  453. if (vm.count("help")) {
  454. std::cout << all << "\n";
  455. }
  456. else if (vm.count("version"))
  457. {
  458. std::cout << GitRevision::GetFullVersion() << "\n";
  459. }
  460. return vm;
  461. }