TrinityCore
Loading...
Searching...
No Matches
Main.cpp File Reference
#include "AppenderDB.h"
#include "AuthSocketMgr.h"
#include "Banner.h"
#include "Config.h"
#include "DatabaseEnv.h"
#include "DatabaseLoader.h"
#include "DeadlineTimer.h"
#include "IoContext.h"
#include "IPLocation.h"
#include "GitRevision.h"
#include "Locales.h"
#include "MySQLThreading.h"
#include "OpenSSLCrypto.h"
#include "ProcessPriority.h"
#include "RealmList.h"
#include "SecretMgr.h"
#include "SharedDefines.h"
#include "Util.h"
#include <boost/asio/signal_set.hpp>
#include <boost/dll/runtime_symbol_info.hpp>
#include <boost/program_options.hpp>
#include <boost/filesystem/operations.hpp>
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
#include <iostream>
#include <csignal>
#include "ServiceWin32.h"
#include <tchar.h>
#include "WheatyExceptionReport.h"
+ Include dependency graph for Main.cpp:

Go to the source code of this file.

Macros

#define _TRINITY_REALM_CONFIG   "authserver.conf"
 
#define _TRINITY_REALM_CONFIG_DIR   "authserver.conf.d"
 

Functions

void ServiceStatusWatcher (std::weak_ptr< Trinity::Asio::DeadlineTimer > serviceStatusWatchTimerRef, std::weak_ptr< Trinity::Asio::IoContext > ioContextRef, boost::system::error_code const &error)
 
bool StartDB ()
 Initialize connection to the database.
 
void StopDB ()
 Close the connection to the database.
 
void SignalHandler (std::weak_ptr< Trinity::Asio::IoContext > ioContextRef, boost::system::error_code const &error, int signalNumber)
 
void KeepDatabaseAliveHandler (std::weak_ptr< Trinity::Asio::DeadlineTimer > dbPingTimerRef, int32 dbPingInterval, boost::system::error_code const &error)
 
void BanExpiryHandler (std::weak_ptr< Trinity::Asio::DeadlineTimer > banExpiryCheckTimerRef, int32 banExpiryCheckInterval, boost::system::error_code const &error)
 
variables_map GetConsoleArguments (int argc, char **argv, fs::path &configFile, fs::path &configDir, std::string &winServiceAction)
 
int main (int argc, char **argv)
 
 INIT_CRASH_HANDLER ()
 

Variables

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

Macro Definition Documentation

◆ _TRINITY_REALM_CONFIG

#define _TRINITY_REALM_CONFIG   "authserver.conf"

Definition at line 58 of file Main.cpp.

◆ _TRINITY_REALM_CONFIG_DIR

#define _TRINITY_REALM_CONFIG_DIR   "authserver.conf.d"

Definition at line 61 of file Main.cpp.

Function Documentation

◆ BanExpiryHandler()

void BanExpiryHandler ( std::weak_ptr< Trinity::Asio::DeadlineTimer banExpiryCheckTimerRef,
int32  banExpiryCheckInterval,
boost::system::error_code const &  error 
)

Definition at line 311 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetConsoleArguments()

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

Definition at line 345 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ INIT_CRASH_HANDLER()

INIT_CRASH_HANDLER ( )

◆ KeepDatabaseAliveHandler()

void KeepDatabaseAliveHandler ( std::weak_ptr< Trinity::Asio::DeadlineTimer dbPingTimerRef,
int32  dbPingInterval,
boost::system::error_code const &  error 
)

Definition at line 296 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 88 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ServiceStatusWatcher()

void ServiceStatusWatcher ( std::weak_ptr< Trinity::Asio::DeadlineTimer serviceStatusWatchTimerRef,
std::weak_ptr< Trinity::Asio::IoContext ioContextRef,
boost::system::error_code const &  error 
)

Definition at line 327 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SignalHandler()

void SignalHandler ( std::weak_ptr< Trinity::Asio::IoContext ioContextRef,
boost::system::error_code const &  error,
int  signalNumber 
)

Definition at line 289 of file Main.cpp.

+ Here is the caller graph for this function:

◆ StartDB()

bool StartDB ( )

Initialize connection to the database.

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 263 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopDB()

void StopDB ( )

Close the connection to the database.

Definition at line 283 of file Main.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ m_ServiceStatus

int m_ServiceStatus = -1

Definition at line 76 of file Main.cpp.

◆ serviceDescription

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

Definition at line 69 of file Main.cpp.

◆ serviceLongName

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

Definition at line 68 of file Main.cpp.

◆ serviceName

TCHAR serviceName[] = _T("authserver")

Definition at line 67 of file Main.cpp.