*Cleaned up database queries - by XTZGZoReX

--HG--
branch : trunk
This commit is contained in:
Blaymoira committed 2009-01-04 17:20:23 +01:00
1 parent c4401376ab
commit c9f0d4292a
18 files changed
+123 -123

No files matched your search

+6 -6
View File
@@ -136,7 +136,7 @@ public:
loopCounter = 0;
sLog.outDetail ("Ping MySQL to keep connection alive");
delete WorldDatabase.Query ("SELECT 1 FROM command LIMIT 1");
delete loginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1");
delete LoginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1");
delete CharacterDatabase.Query ("SELECT 1 FROM bugreport LIMIT 1");
}
}
@@ -239,7 +239,7 @@ int Master::Run()
t.setPriority ((ZThread::Priority )2);
// set server online
loginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID);
LoginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID);
#ifdef WIN32
if (sConfig.GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
@@ -330,7 +330,7 @@ int Master::Run()
sWorldSocketMgr->Wait ();
// set server offline
loginDatabase.PExecute("UPDATE realmlist SET color = 2 WHERE id = '%d'",realmID);
LoginDatabase.PExecute("UPDATE realmlist SET color = 2 WHERE id = '%d'",realmID);
///- Remove signal handling before leaving
_UnhookSignals();
@@ -346,7 +346,7 @@ int Master::Run()
///- Wait for delay threads to end
CharacterDatabase.HaltDelayThread();
WorldDatabase.HaltDelayThread();
loginDatabase.HaltDelayThread();
LoginDatabase.HaltDelayThread();
sLog.outString( "Halting process..." );
@@ -440,7 +440,7 @@ bool Master::_StartDB()
///- Initialise the login database
sLog.outString("Login Database: %s", dbstring.c_str() );
if(!loginDatabase.Initialize(dbstring.c_str()))
if(!LoginDatabase.Initialize(dbstring.c_str()))
{
sLog.outError("Cannot connect to login database %s",dbstring.c_str());
return false;
@@ -469,7 +469,7 @@ void Master::clearOnlineAccounts()
{
// Cleanup online status for characters hosted at current realm
/// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'?
loginDatabase.PExecute(
LoginDatabase.PExecute(
"UPDATE account SET online = 0 WHERE online > 0 "
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);