Adding database thread start/stop functions and init.
This commit is contained in:
@@ -38,6 +38,16 @@ ServerDBGeneric::Init(const string &/*host*/, const string &/*user*/, const stri
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ServerDBGeneric::Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ServerDBGeneric::Stop()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ServerDBGeneric::AsyncPlayerLogin(unsigned requestId, const string &/*playerName*/, const string &/*secretString*/)
|
ServerDBGeneric::AsyncPlayerLogin(unsigned requestId, const string &/*playerName*/, const string &/*secretString*/)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ public:
|
|||||||
virtual void Init(const std::string &host, const std::string &user, const std::string &pwd,
|
virtual void Init(const std::string &host, const std::string &user, const std::string &pwd,
|
||||||
const std::string &database, const std::string &encryptionKey);
|
const std::string &database, const std::string &encryptionKey);
|
||||||
|
|
||||||
|
virtual void Start();
|
||||||
|
virtual void Stop();
|
||||||
|
|
||||||
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString);
|
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString);
|
||||||
virtual bool PlayerLogout(db_id playerId);
|
virtual bool PlayerLogout(db_id playerId);
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ public:
|
|||||||
virtual void Init(const std::string &host, const std::string &user, const std::string &pwd,
|
virtual void Init(const std::string &host, const std::string &user, const std::string &pwd,
|
||||||
const std::string &database, const std::string &encryptionKey) = 0;
|
const std::string &database, const std::string &encryptionKey) = 0;
|
||||||
|
|
||||||
|
virtual void Start() = 0;
|
||||||
|
virtual void Stop() = 0;
|
||||||
|
|
||||||
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString) = 0;
|
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString) = 0;
|
||||||
virtual bool PlayerLogout(db_id playerId) = 0;
|
virtual bool PlayerLogout(db_id playerId) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ ServerLobbyThread::Init(const string &pwd, const string &logDir)
|
|||||||
ReadStatisticsFile();
|
ReadStatisticsFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_database->Init("127.0.0.1", "user", "password", "database", "key");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -594,6 +595,8 @@ void
|
|||||||
ServerLobbyThread::Main()
|
ServerLobbyThread::Main()
|
||||||
{
|
{
|
||||||
InitChatCleaner();
|
InitChatCleaner();
|
||||||
|
// Start database engine.
|
||||||
|
m_database->Start();
|
||||||
// Register all timers.
|
// Register all timers.
|
||||||
RegisterTimers();
|
RegisterTimers();
|
||||||
try
|
try
|
||||||
@@ -611,6 +614,8 @@ ServerLobbyThread::Main()
|
|||||||
m_gameSessionManager.Clear();
|
m_gameSessionManager.Clear();
|
||||||
// Cancel pending timer callbacks.
|
// Cancel pending timer callbacks.
|
||||||
CancelTimers();
|
CancelTimers();
|
||||||
|
// Stop database engine.
|
||||||
|
m_database->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user