Add prepared statement example for auth server ping
--HG-- branch : trunk
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
|
#include "Database/PreparedStatements.h"
|
||||||
|
|
||||||
#include "Configuration/ConfigEnv.h"
|
#include "Configuration/ConfigEnv.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
@@ -313,7 +314,7 @@ extern int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
loopCounter = 0;
|
loopCounter = 0;
|
||||||
sLog.outDetail("Ping MySQL to keep connection alive");
|
sLog.outDetail("Ping MySQL to keep connection alive");
|
||||||
LoginDatabase.Query("SELECT 1 FROM realmlist LIMIT 1");
|
sPreparedStatement.Query(&LoginDatabase, "auth_ping");
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (m_ServiceStatus == 0) stopEvent = true;
|
if (m_ServiceStatus == 0) stopEvent = true;
|
||||||
@@ -345,6 +346,10 @@ bool StartDB()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LoginDatabase.ThreadStart();
|
LoginDatabase.ThreadStart();
|
||||||
|
|
||||||
|
uint32 count = 0;
|
||||||
|
sPreparedStatement.LoadAuthserver(&LoginDatabase, count);
|
||||||
|
sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user