diff options
| author | Kudlaty <none@none> | 2009-09-13 00:02:14 +0200 |
|---|---|---|
| committer | Kudlaty <none@none> | 2009-09-13 00:02:14 +0200 |
| commit | f55031b2425099f989bccfca2a455c609cbaa403 (patch) | |
| tree | 025fb54339bede92c2df5f4fc073326540585067 /src/trinityrealm/RealmList.cpp | |
| parent | da091a901d747d6c52d58da0168f92dd55aa9dbb (diff) | |
Add support for multirealm. Patch by streetrat.
--HG--
branch : trunk
Diffstat (limited to 'src/trinityrealm/RealmList.cpp')
| -rw-r--r-- | src/trinityrealm/RealmList.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/trinityrealm/RealmList.cpp b/src/trinityrealm/RealmList.cpp index 4de3a796179..93d3a8da372 100644 --- a/src/trinityrealm/RealmList.cpp +++ b/src/trinityrealm/RealmList.cpp @@ -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) +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]; @@ -61,6 +61,7 @@ void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::stri std::ostringstream ss; ss << address << ":" << port; realm.address = ss.str(); + realm.gamebuild = build; } void RealmList::UpdateIfNeed() @@ -82,7 +83,7 @@ void RealmList::UpdateRealms(bool init) { sLog.outDetail("Updating Realm List..."); - QueryResult *result = loginDatabase.Query( "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population 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) @@ -93,7 +94,7 @@ 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() ); + 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() ); |
