diff options
author | Chaz Brown <iamparadox@netscape.net> | 2009-09-19 00:51:47 -0400 |
---|---|---|
committer | Chaz Brown <iamparadox@netscape.net> | 2009-09-19 00:51:47 -0400 |
commit | 15d85229fae45405557aa6b706681dabaf854ed5 (patch) | |
tree | ea76da95ba40d28f0c217ca3bfc429797c373764 /src/trinityrealm/RealmList.cpp | |
parent | 118e01a08e45c0a2824fb708b93769714f3ffa2e (diff) |
Replace useless code with more useful code.
--HG--
branch : trunk
Diffstat (limited to 'src/trinityrealm/RealmList.cpp')
-rw-r--r-- | src/trinityrealm/RealmList.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/trinityrealm/RealmList.cpp b/src/trinityrealm/RealmList.cpp index 93d3a8da372..be8a7738ef7 100644 --- a/src/trinityrealm/RealmList.cpp +++ b/src/trinityrealm/RealmList.cpp @@ -27,11 +27,11 @@ #include "Policies/SingletonImp.h" #include "Database/DatabaseEnv.h" -INSTANTIATE_SINGLETON_1( RealmList ); +INSTANTIATE_SINGLETON_1(RealmList); extern DatabaseType loginDatabase; -RealmList::RealmList( ) : m_UpdateInterval(0), m_NextUpdateTime(time(NULL)) +RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(NULL)) { } @@ -44,7 +44,7 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { ///- Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -67,7 +67,7 @@ void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::stri void RealmList::UpdateIfNeed() { // maybe disabled or updated recently - if(!m_UpdateInterval || m_NextUpdateTime > time(NULL)) + if (!m_UpdateInterval || m_NextUpdateTime > time(NULL)) return; m_NextUpdateTime = time(NULL) + m_UpdateInterval; @@ -83,10 +83,10 @@ void RealmList::UpdateRealms(bool init) { sLog.outDetail("Updating Realm List..."); - QueryResult *result = loginDatabase.Query( "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name" ); + QueryResult *result = loginDatabase.Query("SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name"); ///- Circle through results and add them to the realm map - if(result) + if (result) { do { @@ -94,10 +94,10 @@ void RealmList::UpdateRealms(bool init) uint8 allowedSecurityLevel = fields[7].GetUInt8(); - UpdateRealm(fields[0].GetUInt32(), fields[1].GetCppString(),fields[2].GetCppString(),fields[3].GetUInt32(),fields[4].GetUInt8(), fields[5].GetUInt8(), fields[6].GetUInt8(), (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), fields[8].GetFloat(), fields[9].GetUInt32() ); - if(init) + UpdateRealm(fields[0].GetUInt32(), fields[1].GetCppString(),fields[2].GetCppString(),fields[3].GetUInt32(),fields[4].GetUInt8(), fields[5].GetUInt8(), fields[6].GetUInt8(), (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), fields[8].GetFloat(), fields[9].GetUInt32()); + if (init) sLog.outString("Added realm \"%s\".", fields[1].GetString()); - } while( result->NextRow() ); + } while(result->NextRow()); delete result; } } |