From ad8010730cefcf18e27c21a47be47b57b1f6bf40 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 28 Aug 2012 01:11:03 +0200 Subject: Core/Authserver: Improved realmlist for multiple realms with different versions, idea from MaNGOS and allow 4.0.6a, 4.2.2 and 4.3.4 clients to use the authserver (no world connections) --- src/server/authserver/Authentication/AuthCodes.cpp | 47 ++++++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) (limited to 'src/server/authserver/Authentication/AuthCodes.cpp') diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index ace18e7b45c..6ca1050d153 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -19,12 +19,32 @@ namespace AuthHelper { - bool IsPreBCAcceptedClientBuild(int build) + static RealmBuildInfo const PostBcAcceptedClientBuilds[] = + { + {15595, 4, 3, 4, ' '}, + {14545, 4, 2, 2, ' '}, + {13623, 4, 0, 6, 'a'}, + {12340, 3, 3, 5, 'a'}, + {11723, 3, 3, 3, 'a'}, + {11403, 3, 3, 2, ' '}, + {11159, 3, 3, 0, 'a'}, + {10505, 3, 2, 2, 'a'}, + {9947, 3, 1, 3, ' '}, + {8606, 2, 4, 3, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + static RealmBuildInfo const PreBcAcceptedClientBuilds[] = { - int accepted_versions[] = PRE_BC_ACCEPTED_CLIENT_BUILD; + {6005, 1, 12, 2, ' '}, + {5875, 1, 12, 1, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + bool IsPreBCAcceptedClientBuild(int build) + { + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) return true; return false; @@ -32,10 +52,8 @@ namespace AuthHelper bool IsPostBCAcceptedClientBuild(int build) { - int accepted_versions[] = POST_BC_ACCEPTED_CLIENT_BUILD; - - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) return true; return false; @@ -45,4 +63,17 @@ namespace AuthHelper { return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); } + + RealmBuildInfo const* GetBuildInfo(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) + return &PostBcAcceptedClientBuilds[i]; + + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return &PreBcAcceptedClientBuilds[i]; + + return NULL; + } }; -- cgit v1.2.3 From 154aaa0ad5b673c6d52f6d4c88baa450a82226de Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 00:25:49 +0100 Subject: Core/Quests: Fix quest honor reward Based on the patch of Tassader Closes #1356 --- src/server/authserver/Authentication/AuthCodes.cpp | 1 + src/server/game/DataStores/DBCStores.cpp | 2 -- src/server/game/DataStores/DBCStores.h | 1 - src/server/game/DataStores/DBCStructure.h | 6 ------ src/server/game/DataStores/DBCfmt.h | 1 - src/server/game/Entities/Player/Player.cpp | 6 ++++-- src/server/game/Quests/QuestDef.cpp | 20 -------------------- src/server/game/Quests/QuestDef.h | 1 - 8 files changed, 5 insertions(+), 33 deletions(-) (limited to 'src/server/authserver/Authentication/AuthCodes.cpp') diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index 6ca1050d153..bdb96ca0d25 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -16,6 +16,7 @@ */ #include "AuthCodes.h" +#include namespace AuthHelper { diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 850c58bdf93..38f666b5f1f 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -185,7 +185,6 @@ DBCStorage sTaxiPathStore(TaxiPathEntryfmt); TaxiPathNodesByPath sTaxiPathNodesByPath; static DBCStorage sTaxiPathNodeStore(TaxiPathNodeEntryfmt); -DBCStorage sTeamContributionPointsStore(TeamContributionPointsfmt); DBCStorage sTotemCategoryStore(TotemCategoryEntryfmt); DBCStorage sVehicleStore(VehicleEntryfmt); DBCStorage sVehicleSeatStore(VehicleSeatEntryfmt); @@ -593,7 +592,6 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index cd30ed587f8..c5c9159f4e0 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -164,7 +164,6 @@ extern TaxiMask sAllianceTaxiNodesMask; extern TaxiMask sDeathKnightTaxiNodesMask; extern TaxiPathSetBySource sTaxiPathSetBySource; extern TaxiPathNodesByPath sTaxiPathNodesByPath; -extern DBCStorage sTeamContributionPointsStore; extern DBCStorage sTotemCategoryStore; extern DBCStorage sVehicleStore; extern DBCStorage sVehicleSeatStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index fdec06f6f48..8e3c686baf4 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1845,12 +1845,6 @@ struct TaxiPathNodeEntry uint32 departureEventID; // 10 m_departureEventID }; -struct TeamContributionPointsEntry -{ - //uint32 entry; // 0 - float value; // 1 (???) -}; - struct TotemCategoryEntry { uint32 ID; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 39d031e96f9..29f90a9b0dd 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -117,7 +117,6 @@ const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix"; const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; const char TaxiPathEntryfmt[]="niii"; const char TaxiPathNodeEntryfmt[]="diiifffiiii"; -const char TeamContributionPointsfmt[]="df"; const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f97582a0198..88f00ac7f60 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -15127,8 +15127,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, } // honor reward - if (uint32 honor = quest->CalculateHonorGain(getLevel())) - RewardHonor(NULL, 0, honor); + if (quest->GetRewHonorAddition()) + ModifyHonorPoints(quest->GetRewHonorAddition()); + if (quest->GetRewHonorMultiplier()) + ModifyHonorPoints(Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier())); // title reward if (quest->GetCharTitleId()) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 9221da53003..c8193ec60ad 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -227,23 +227,3 @@ bool Quest::IsAllowedInRaid() const return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); } - -uint32 Quest::CalculateHonorGain(uint8 level) const -{ - if (level > GT_MAX_LEVEL) - level = GT_MAX_LEVEL; - - uint32 honor = 0; - - if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) - { - // values stored from 0.. for 1... - TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1); - if (!tc) - return 0; - honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161); - honor += GetRewHonorAddition(); - } - - return honor; -} diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 7f22b441afe..5c0437afb6f 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -257,7 +257,6 @@ class Quest bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } bool IsAllowedInRaid() const; bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } - uint32 CalculateHonorGain(uint8 level) const; // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; -- cgit v1.2.3