Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Master Class Reference

Start the server. More...

#include <Master.h>

Public Member Functions

int Run ()
 Main function.
void SetDatabaseAuth (const char *authDB)
void SetDatabaseChars (const char *charactersDB)
void SetDatabaseHost (const char *db_Host)
void SetDatabasePassword (const char *db_Password)
void SetDatabasePort (const char *db_Port)
void SetDatabaseUser (const char *db_User)
void SetDatabaseWorld (const char *worldDB)
void SetNoUseConfigDatabaseInfo (bool noUseConfigDatabaseInfo)

Private Member Functions

bool _StartDB ()
 Initialize connection to the databases.
void _StopDB ()
void ClearOnlineAccounts ()
 Clear 'online' status for all accounts with characters in this realm.

Private Attributes

const char * _authDB
const char * _charactersDB
const char * _dbHost
const char * _dbPassword
const char * _dbPort
const char * _dbUser
bool _noUseConfigDatabaseInfo = false
const char * _worldDB

Detailed Description

Start the server.

Definition at line 17 of file Master.h.

Member Function Documentation

◆ _StartDB()

bool Master::_StartDB ( )
private

Initialize connection to the databases.

  • Initialize the world database
  • Get character database info from configuration file
  • Initialize the Character database
  • Initialize the Character database
  • Get login database info from configuration file
  • Initialise the login database
  • Clean the database before starting
  • Insert version info into DB

Definition at line 630 of file Master.cpp.

References _authDB, _charactersDB, _dbHost, _dbPassword, _dbPort, _dbUser, _noUseConfigDatabaseInfo, _worldDB, CharacterDatabase, ClearOnlineAccounts(), Field::GetString(), Field::GetUInt32(), MySQL::Library_Init(), LOGIN_SEL_REALMLIST, LoginDatabase, realmNameStore, sConfigMgr, PreparedStatement::setInt32(), SF_LOG_ERROR, SF_LOG_INFO, sWorld, and WorldDatabase.

Referenced by Run().

◆ _StopDB()

void Master::_StopDB ( )
private

Definition at line 800 of file Master.cpp.

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

Referenced by Run().

◆ ClearOnlineAccounts()

void Master::ClearOnlineAccounts ( )
private

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

Definition at line 810 of file Master.cpp.

References CharacterDatabase, LoginDatabase, and realmNameStore.

Referenced by _StartDB(), and Run().

◆ Run()

int Master::Run ( )

Main function.

  • Check the version of the configuration file

worldserver PID file creation

  • Start the databases
  • Register worldserver's signal handlers
  • Start up freeze catcher thread
  • Launch the world listener socket
  • Clean database before leaving

Definition at line 352 of file Master.cpp.

References _StartDB(), _StopDB(), ClearOnlineAccounts(), CONFIG_PORT_WORLD, CreatePIDFile(), ERROR_EXIT_CODE, World::GetExitCode(), SFSoapService::Join(), Skyfire::Asio::IoContextTaskRunner::Join(), LoginDatabase, REALM_FLAG_INVALID, REALM_FLAG_OFFLINE, realmNameStore, sConfigMgr, FreezeDetectorRunnable::SetDelayTime(), BigNumber::SetRand(), SF_LOG_ERROR, SF_LOG_INFO, SKYFIREWORLD_CONFIG_VERSION, SFSoapService::Start(), Skyfire::Asio::IoContextTaskRunner::Start(), World::StopNow(), sWorld, sWorldSocketMgr, and WorldServerSignalHandler().

◆ SetDatabaseAuth()

void Master::SetDatabaseAuth ( const char * authDB)
inline

Definition at line 27 of file Master.h.

References _authDB.

◆ SetDatabaseChars()

void Master::SetDatabaseChars ( const char * charactersDB)
inline

Definition at line 28 of file Master.h.

References _charactersDB.

◆ SetDatabaseHost()

void Master::SetDatabaseHost ( const char * db_Host)
inline

Definition at line 23 of file Master.h.

References _dbHost.

◆ SetDatabasePassword()

void Master::SetDatabasePassword ( const char * db_Password)
inline

Definition at line 26 of file Master.h.

References _dbPassword.

◆ SetDatabasePort()

void Master::SetDatabasePort ( const char * db_Port)
inline

Definition at line 24 of file Master.h.

References _dbPort.

◆ SetDatabaseUser()

void Master::SetDatabaseUser ( const char * db_User)
inline

Definition at line 25 of file Master.h.

References _dbUser.

◆ SetDatabaseWorld()

void Master::SetDatabaseWorld ( const char * worldDB)
inline

Definition at line 29 of file Master.h.

References _worldDB.

◆ SetNoUseConfigDatabaseInfo()

void Master::SetNoUseConfigDatabaseInfo ( bool noUseConfigDatabaseInfo)
inline

Definition at line 22 of file Master.h.

References _noUseConfigDatabaseInfo.

Member Data Documentation

◆ _authDB

const char* Master::_authDB
private

Definition at line 42 of file Master.h.

Referenced by _StartDB(), and SetDatabaseAuth().

◆ _charactersDB

const char* Master::_charactersDB
private

Definition at line 43 of file Master.h.

Referenced by _StartDB(), and SetDatabaseChars().

◆ _dbHost

const char* Master::_dbHost
private

Definition at line 38 of file Master.h.

Referenced by _StartDB(), and SetDatabaseHost().

◆ _dbPassword

const char* Master::_dbPassword
private

Definition at line 41 of file Master.h.

Referenced by _StartDB(), and SetDatabasePassword().

◆ _dbPort

const char* Master::_dbPort
private

Definition at line 39 of file Master.h.

Referenced by _StartDB(), and SetDatabasePort().

◆ _dbUser

const char* Master::_dbUser
private

Definition at line 40 of file Master.h.

Referenced by _StartDB(), and SetDatabaseUser().

◆ _noUseConfigDatabaseInfo

bool Master::_noUseConfigDatabaseInfo = false
private

Definition at line 37 of file Master.h.

Referenced by _StartDB(), and SetNoUseConfigDatabaseInfo().

◆ _worldDB

const char* Master::_worldDB
private

Definition at line 44 of file Master.h.

Referenced by _StartDB(), and SetDatabaseWorld().


The documentation for this class was generated from the following files: