TrinityCore
Loading...
Searching...
No Matches
Main.cpp File Reference
#include "Common.h"
#include "AppenderDB.h"
#include "AsyncAcceptor.h"
#include "Banner.h"
#include "BattlegroundMgr.h"
#include "BigNumber.h"
#include "CliRunnable.h"
#include "Configuration/Config.h"
#include "DatabaseEnv.h"
#include "DatabaseLoader.h"
#include "DeadlineTimer.h"
#include "GitRevision.h"
#include "InstanceSaveMgr.h"
#include "IoContext.h"
#include "Locales.h"
#include "MapManager.h"
#include "Metric.h"
#include "MySQLThreading.h"
#include "ObjectAccessor.h"
#include "OpenSSLCrypto.h"
#include "OutdoorPvP/OutdoorPvPMgr.h"
#include "ProcessPriority.h"
#include "RASession.h"
#include "RealmList.h"
#include "Resolver.h"
#include "ScriptLoader.h"
#include "ScriptMgr.h"
#include "ScriptReloadMgr.h"
#include "SecretMgr.h"
#include "SharedDefines.h"
#include "TCSoap.h"
#include "ThreadPool.h"
#include "World.h"
#include "WorldSocket.h"
#include "WorldSocketMgr.h"
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#include <boost/asio/signal_set.hpp>
#include <boost/dll/runtime_symbol_info.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/program_options.hpp>
#include <csignal>
#include <iostream>
#include "ServiceWin32.h"
#include <tchar.h>
#include <boost/dll/shared_library.hpp>
#include <timeapi.h>
#include "WheatyExceptionReport.h"
+ Include dependency graph for Main.cpp:

Go to the source code of this file.

Classes

class  FreezeDetector
 

Macros

#define _TRINITY_CORE_CONFIG   "worldserver.conf"
 
#define _TRINITY_CORE_CONFIG_DIR   "worldserver.conf.d"
 

Functions

void SignalHandler (boost::system::error_code const &error, int signalNumber)
 
std::unique_ptr< Trinity::Net::AsyncAcceptor > StartRaSocketAcceptor (Trinity::Asio::IoContext &ioContext)
 
bool StartDB ()
 Initialize connection to the databases.
 
void StopDB ()
 
void WorldUpdateLoop ()
 
void ClearOnlineAccounts ()
 Clear 'online' status for all accounts with characters in this realm.
 
void ShutdownCLIThread (std::thread *cliThread)
 
bool LoadRealmInfo (Trinity::Asio::IoContext &ioContext)
 
variables_map GetConsoleArguments (int argc, char **argv, fs::path &configFile, fs::path &configDir, std::string &winServiceAction)
 
int main (int argc, char **argv)
 Launch the Trinity server.
 
 INIT_CRASH_HANDLER ()
 

Variables

TCHAR serviceName [] = _T("worldserver")
 
TCHAR serviceLongName [] = _T("TrinityCore world service")
 
TCHAR serviceDescription [] = _T("TrinityCore World of Warcraft emulator world service")
 
int m_ServiceStatus = -1
 

Macro Definition Documentation

◆ _TRINITY_CORE_CONFIG

#define _TRINITY_CORE_CONFIG   "worldserver.conf"

Definition at line 66 of file Main.cpp.

◆ _TRINITY_CORE_CONFIG_DIR

#define _TRINITY_CORE_CONFIG_DIR   "worldserver.conf.d"

Definition at line 70 of file Main.cpp.

Function Documentation

◆ ClearOnlineAccounts()

void ClearOnlineAccounts ( )

Clear 'online' status for all accounts with characters in this realm.

Definition at line 698 of file Main.cpp.

References CharacterDatabase, Realm::Id, LoginDatabase, realm, and RealmHandle::Realm.

Referenced by main(), and StartDB().

◆ GetConsoleArguments()

variables_map GetConsoleArguments ( int  argc,
char **  argv,
fs::path &  configFile,
fs::path &  configDir,
std::string &  winServiceAction 
)

Definition at line 710 of file Main.cpp.

References _TRINITY_CORE_CONFIG, _TRINITY_CORE_CONFIG_DIR, and GitRevision::GetFullVersion().

Referenced by main().

◆ INIT_CRASH_HANDLER()

INIT_CRASH_HANDLER ( )

◆ LoadRealmInfo()

◆ main()

◆ ShutdownCLIThread()

void ShutdownCLIThread ( std::thread *  cliThread)

Definition at line 434 of file Main.cpp.

References TC_LOG_DEBUG.

Referenced by main().

◆ SignalHandler()

void SignalHandler ( boost::system::error_code const &  error,
int  signalNumber 
)

Definition at line 544 of file Main.cpp.

References SHUTDOWN_EXIT_CODE, and World::StopNow().

Referenced by main().

◆ StartDB()

bool StartDB ( )

Initialize connection to the databases.

  • Get the realm Id from the configuration file
  • Clean the database before starting
  • Insert version info into DB

Definition at line 652 of file Main.cpp.

References DatabaseLoader::AddDatabase(), CharacterDatabase, ClearOnlineAccounts(), DatabaseLoader::DATABASE_NONE, GitRevision::GetFullVersion(), GitRevision::GetHash(), Realm::Id, MySQL::Library_Init(), DatabaseLoader::Load(), LoginDatabase, realm, RealmHandle::Realm, sConfigMgr, sWorld, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.

Referenced by main().

◆ StartRaSocketAcceptor()

std::unique_ptr< Trinity::Net::AsyncAcceptor > StartRaSocketAcceptor ( Trinity::Asio::IoContext &  ioContext)

Definition at line 584 of file Main.cpp.

References sConfigMgr, and TC_LOG_ERROR.

Referenced by main().

◆ StopDB()

void StopDB ( )

Definition at line 688 of file Main.cpp.

References CharacterDatabase, MySQL::Library_End(), LoginDatabase, and WorldDatabase.

Referenced by main().

◆ WorldUpdateLoop()

void WorldUpdateLoop ( )

Variable Documentation

◆ m_ServiceStatus

int m_ServiceStatus = -1

Definition at line 85 of file Main.cpp.

Referenced by main(), and WorldUpdateLoop().

◆ serviceDescription

TCHAR serviceDescription[] = _T("TrinityCore World of Warcraft emulator world service")

Definition at line 78 of file Main.cpp.

Referenced by main().

◆ serviceLongName

TCHAR serviceLongName[] = _T("TrinityCore world service")

Definition at line 77 of file Main.cpp.

Referenced by main().

◆ serviceName

TCHAR serviceName[] = _T("worldserver")

Definition at line 76 of file Main.cpp.

Referenced by main().