diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-09-05 16:46:14 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-09-05 16:46:14 +0200 |
commit | d25c2e7f5b6ac7bb79960037cc728a46450d5609 (patch) | |
tree | a8d7f053a8d518423316e533958cdc79c714ab0d /src/server/authserver/Server/AuthSocket.cpp | |
parent | 6514e21b7cd8ec3ef7c0c44653d99245b3f57012 (diff) | |
parent | 458f5b9502da9f861ba729142dd63c3a98191ece (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
src/server/game/Battlegrounds/BattlegroundMgr.cpp
src/server/game/Guilds/Guild.h
src/server/game/Spells/SpellMgr.cpp
src/tools/map_extractor/loadlib.cpp
Diffstat (limited to 'src/server/authserver/Server/AuthSocket.cpp')
-rw-r--r-- | src/server/authserver/Server/AuthSocket.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 93c03e26c88..1ab9ae6eb62 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -387,7 +387,7 @@ bool AuthSocket::_HandleLogonChallenge() TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); - if (strcmp(fields[4].GetCString(), ip_address.c_str())) + if (strcmp(fields[4].GetCString(), ip_address.c_str()) != 0) { TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP differs"); pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); @@ -930,12 +930,13 @@ bool AuthSocket::_HandleRealmList() size_t RealmListSize = 0; for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { + const Realm &realm = i->second; // don't work with realms which not compatible with the client - bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild)); + bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && realm.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(realm.gamebuild)); // No SQL injection. id of realm is controlled by the database. - uint32 flag = i->second.flag; - RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild); + uint32 flag = realm.flag; + RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(realm.gamebuild); if (!okBuild) { if (!buildInfo) @@ -956,27 +957,27 @@ bool AuthSocket::_HandleRealmList() } // We don't need the port number from which client connects with but the realm's port - clientAddr.set_port_number(i->second.ExternalAddress.get_port_number()); + clientAddr.set_port_number(realm.ExternalAddress.get_port_number()); - uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; + uint8 lock = (realm.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; uint8 AmountOfCharacters = 0; stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM); - stmt->setUInt32(0, i->second.m_ID); + stmt->setUInt32(0, realm.m_ID); stmt->setUInt32(1, id); result = LoginDatabase.Query(stmt); if (result) AmountOfCharacters = (*result)[0].GetUInt8(); - pkt << i->second.icon; // realm type + pkt << realm.icon; // realm type if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients pkt << lock; // if 1, then realm locked pkt << uint8(flag); // RealmFlags pkt << name; - pkt << GetAddressString(GetAddressForClient(i->second, clientAddr)); - pkt << i->second.populationLevel; + pkt << GetAddressString(GetAddressForClient(realm, clientAddr)); + pkt << realm.populationLevel; pkt << AmountOfCharacters; - pkt << i->second.timezone; // realm category + pkt << realm.timezone; // realm category if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients pkt << uint8(0x2C); // unk, may be realm number/id? else |