diff options
author | Nay <dnpd.dd@gmail.com> | 2012-08-28 14:11:04 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-08-28 14:11:04 +0100 |
commit | 9bb198d17037a9b41be09d137bb6237f9acd62c5 (patch) | |
tree | 4202a0472a6ef8ccd19613b0f4b8c1ab0ddb1e2b | |
parent | e4aacd3f86f2e2d44d062c9df3f2f2775fa9ca62 (diff) | |
parent | ec527fa172f64f47406d9317b8c3a98e9c46f812 (diff) |
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
src/server/authserver/Authentication/AuthCodes.cpp
src/server/authserver/Authentication/AuthCodes.h
src/server/authserver/Server/AuthSocket.cpp
src/server/game/Entities/Creature/GossipDef.cpp
src/server/game/Entities/Player/Player.cpp
-rw-r--r-- | src/server/authserver/Server/AuthSocket.cpp | 61 | ||||
-rwxr-xr-x | src/server/game/Entities/Creature/GossipDef.cpp | 4 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 5 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.h | 2 |
4 files changed, 46 insertions, 26 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index c0cf24efbfb..793f310f8c1 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -343,6 +343,7 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; + _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); _os = (const char*)ch->os; if (_os.size() > 4) @@ -357,13 +358,13 @@ bool AuthSocket::_HandleLogonChallenge() // Verify that this IP is not in the ip_banned table LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS)); - const std::string& ip_address = socket().getRemoteAddress(); - PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); + std::string const& ip_address = socket().getRemoteAddress(); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); stmt->setString(0, ip_address); PreparedQueryResult result = LoginDatabase.Query(stmt); if (result) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); } else @@ -410,12 +411,12 @@ bool AuthSocket::_HandleLogonChallenge() { if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } else { - pkt << (uint8)WOW_FAIL_SUSPENDED; + pkt << uint8(WOW_FAIL_SUSPENDED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } } @@ -454,6 +455,8 @@ bool AuthSocket::_HandleLogonChallenge() pkt << uint8(WOW_FAIL_VERSION_INVALID); else pkt << uint8(WOW_SUCCESS); + else + pkt << uint8(WOW_FAIL_VERSION_INVALID); // B may be calculated < 32B so we force minimal length to 32B pkt.append(B.AsByteArray(32), 32); // 32 bytes @@ -831,39 +834,53 @@ bool AuthSocket::_HandleRealmList() { // don't work with realms which not compatible with the client if (i->second.gamebuild != _build) + uint32 flag = i->second.flag; + RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild); + if (!okBuild) + { + if (!buildInfo) continue; - uint8 AmountOfCharacters; + flag |= REALM_FLAG_OFFLINE | REALM_FLAG_SPECIFYBUILD; // tell the client what build the realm is for + } + + if (!buildInfo) + flag &= ~REALM_FLAG_SPECIFYBUILD; + + std::string name = i->first; + if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD) + { + std::ostringstream ss; + ss << name << " (" << buildInfo->MajorVersion << '.' << buildInfo->MinorVersion << '.' << buildInfo->BugfixVersion << ')'; + name = ss.str(); + } - // No SQL injection. id of realm is controlled by the database. + uint8 lock = (i->second.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(1, id); result = LoginDatabase.Query(stmt); if (result) AmountOfCharacters = (*result)[0].GetUInt8(); - else - AmountOfCharacters = 0; - - uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; pkt << i->second.icon; // realm type pkt << lock; // if 1, then realm locked - pkt << uint8(i->second.flag); // RealmFlags - pkt << i->first; + pkt << uint8(flag); // RealmFlags + pkt << name; pkt << i->second.address; pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category pkt << uint8(0x2C); // unk, may be realm number/id? - if (i->second.flag & REALM_FLAG_SPECIFYBUILD) + if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD) { - // TODO: Make this customizable - pkt << uint8(3); - pkt << uint8(3); - pkt << uint8(5); - pkt << uint16(12340); + pkt << uint8(buildInfo->MajorVersion); + pkt << uint8(buildInfo->MinorVersion); + pkt << uint8(buildInfo->BugfixVersion); + pkt << uint16(buildInfo->Build); } ++RealmListSize; @@ -875,7 +892,7 @@ bool AuthSocket::_HandleRealmList() // make a ByteBuffer which stores the RealmList's size ByteBuffer RealmListSizeBuffer; - RealmListSizeBuffer << (uint32)0; + RealmListSizeBuffer << uint32(0); RealmListSizeBuffer << uint16(RealmListSize); ByteBuffer hdr; @@ -948,7 +965,9 @@ PatcherRunnable::PatcherRunnable(class AuthSocket* as) } // Send content of patch file to the client -void PatcherRunnable::run() {} +void PatcherRunnable::run() +{ +} // Preload MD5 hashes of existing patch files on server #ifndef _WIN32 diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 05ec6f6920d..52a9de09f30 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -417,8 +417,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << int32(quest->GetRewSpellCast()); // casted spell // rewarded honor points - data << Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0); // new reward honor (multipled by ~62 at client side) + data << uint32(quest->GetRewHonorAddition()); + data << float(quest->GetRewHonorMultiplier()); data << uint32(quest->GetSrcItemId()); // source item id data << uint32(quest->GetFlags() & 0xFFFF); // quest flags data << uint32(quest->GetMinimapTargetMark()); // minimap target mark (skull, etc. missing enum) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 2a16756161b..6aa9500b998 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -347,10 +347,11 @@ uint32 Quest::CalculateHonorGain(uint8 level) const /*if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) { // values stored from 0.. for 1... - TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1); + TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level); if (!tc) return 0; - honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161); + + honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f); honor += GetRewHonorAddition(); }*/ diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 2b4ad24e78f..53ba7ea0d09 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -213,7 +213,7 @@ class Quest int32 GetZoneOrSort() const { return ZoneOrSort; } uint32 GetMinLevel() const { return MinLevel; } uint32 GetMaxLevel() const { return MaxLevel; } - uint32 GetQuestLevel() const { return Level; } + int32 GetQuestLevel() const { return Level; } uint32 GetType() const { return Type; } uint32 GetRequiredClasses() const { return RequiredClasses; } uint32 GetRequiredRaces() const { return RequiredRaces; } |