![]() |
TrinityCore
|
#include "AppenderDB.h"#include "Banner.h"#include "BigNumber.h"#include "Config.h"#include "DatabaseEnv.h"#include "DatabaseLoader.h"#include "DeadlineTimer.h"#include "GitRevision.h"#include "IPLocation.h"#include "IpNetwork.h"#include "Locales.h"#include "LoginRESTService.h"#include "Memory.h"#include "MySQLThreading.h"#include "OpenSSLCrypto.h"#include "ProcessPriority.h"#include "RealmList.h"#include "SecretMgr.h"#include "SessionManager.h"#include "SslContext.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 <google/protobuf/stubs/common.h>#include <iostream>#include <csignal>#include "Hacks/boost_program_options_with_filesystem_path.h"#include "ServiceWin32.h"#include <tchar.h>
Include dependency graph for Main.cpp:Go to the source code of this file.
Macros | |
| #define | _TRINITY_BNET_CONFIG "bnetserver.conf" |
| #define | _TRINITY_BNET_CONFIG_DIR "bnetserver.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 (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) |
Variables | |
| TCHAR | serviceName [] = _T("bnetserver") |
| TCHAR | serviceLongName [] = _T("TrinityCore bnet service") |
| TCHAR | serviceDescription [] = _T("TrinityCore Battle.net emulator authentication service") |
| int | m_ServiceStatus = -1 |
| std::atomic< bool > | Stopped |
| void BanExpiryHandler | ( | std::weak_ptr< Trinity::Asio::DeadlineTimer > | banExpiryCheckTimerRef, |
| int32 | banExpiryCheckInterval, | ||
| boost::system::error_code const & | error | ||
| ) |
Definition at line 354 of file Main.cpp.
References BanExpiryHandler(), LOGIN_DEL_BNET_EXPIRED_ACCOUNT_BANNED, LOGIN_DEL_EXPIRED_IP_BANS, LOGIN_UPD_EXPIRED_ACCOUNT_BANS, and LoginDatabase.
Referenced by BanExpiryHandler(), and main().
| variables_map GetConsoleArguments | ( | int | argc, |
| char ** | argv, | ||
| fs::path & | configFile, | ||
| fs::path & | configDir, | ||
| std::string & | winServiceAction | ||
| ) |
Definition at line 397 of file Main.cpp.
References _TRINITY_BNET_CONFIG, _TRINITY_BNET_CONFIG_DIR, and GitRevision::GetFullVersion().
Referenced by main().
| void KeepDatabaseAliveHandler | ( | std::weak_ptr< Trinity::Asio::DeadlineTimer > | dbPingTimerRef, |
| int32 | dbPingInterval, | ||
| boost::system::error_code const & | error | ||
| ) |
Definition at line 336 of file Main.cpp.
References KeepDatabaseAliveHandler(), LoginDatabase, and TC_LOG_DEBUG.
Referenced by KeepDatabaseAliveHandler(), and main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 93 of file Main.cpp.
References _TRINITY_BNET_CONFIG, _TRINITY_BNET_CONFIG_DIR, Trinity::AbortHandler(), BanExpiryHandler(), CONFIG_HIGH_PRIORITY, CONFIG_PROCESSOR_AFFINITY, CreatePIDFile(), GetConsoleArguments(), Trinity::Locale::Init(), Trinity::Service::Init(), Battlenet::SslContext::Initialize(), Trinity::Service::Install(), KeepDatabaseAliveHandler(), m_ServiceStatus, main(), Trinity::make_unique_ptr_with_deleter(), Trinity::Asio::IoContext::run(), Trinity::Service::Run(), Trinity::Net::ScanLocalNetworks(), sConfigMgr, SECRET_OWNER_BNETSERVER, serviceDescription, serviceLongName, serviceName, ServiceStatusWatcher(), SetProcessPriority(), Trinity::Banner::Show(), SignalHandler(), sIPLocation, sLog, sLoginService, sRealmList, sSecretMgr, sSessionMgr, StartDB(), StopDB(), Stopped, TC_LOG_ERROR, TC_LOG_INFO, OpenSSLCrypto::threadsCleanup(), OpenSSLCrypto::threadsSetup(), Trinity::Service::Uninstall(), and Trinity::VerifyOsVersion().
Referenced by main().
| 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 374 of file Main.cpp.
References m_ServiceStatus, ServiceStatusWatcher(), and Stopped.
Referenced by main(), and ServiceStatusWatcher().
| void SignalHandler | ( | boost::system::error_code const & | error, |
| int | signalNumber | ||
| ) |
| bool StartDB | ( | ) |
Initialize connection to the database.
Initialize connection to the databases.
Definition at line 306 of file Main.cpp.
References DatabaseLoader::AddDatabase(), DatabaseLoader::DATABASE_NONE, MySQL::Library_Init(), DatabaseLoader::Load(), LoginDatabase, sLog, and TC_LOG_INFO.
Referenced by main().
| void StopDB | ( | ) |
Close the connection to the database.
Definition at line 324 of file Main.cpp.
References MySQL::Library_End(), and LoginDatabase.
Referenced by main().
| int m_ServiceStatus = -1 |
Definition at line 79 of file Main.cpp.
Referenced by main(), and ServiceStatusWatcher().
| TCHAR serviceDescription[] = _T("TrinityCore Battle.net emulator authentication service") |
Definition at line 72 of file Main.cpp.
Referenced by Trinity::Service::Init(), and main().
| TCHAR serviceLongName[] = _T("TrinityCore bnet service") |
Definition at line 71 of file Main.cpp.
Referenced by Trinity::Service::Init(), and main().
| TCHAR serviceName[] = _T("bnetserver") |
Definition at line 70 of file Main.cpp.
Referenced by Trinity::Service::Init(), and main().
| std::atomic<bool> Stopped |
Definition at line 91 of file Main.cpp.
Referenced by main(), ServiceStatusWatcher(), and SignalHandler().