From e8b60b4ef885e616a8ace6c03f6d64366cb8f619 Mon Sep 17 00:00:00 2001 From: Shadez Date: Sun, 26 Dec 2010 14:01:47 +0800 Subject: [PATCH] [424] Trinity Core patch updated to 10892 revision (except arena patch) --- includes/revision_nr.php | 2 +- tools/trinity_core/Revision.txt | 2 +- tools/trinity_core/sql/characters_patch.sql | 1 + .../sql/update_character_feed_log.sql | 1 + tools/trinity_core/wowarmory_patch.patch | 89 ++++++++++++++----- 5 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 tools/trinity_core/sql/update_character_feed_log.sql diff --git a/includes/revision_nr.php b/includes/revision_nr.php index a3862ca84..69588fb0a 100644 --- a/includes/revision_nr.php +++ b/includes/revision_nr.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/tools/trinity_core/Revision.txt b/tools/trinity_core/Revision.txt index 6b327c930..a0caf6c14 100644 --- a/tools/trinity_core/Revision.txt +++ b/tools/trinity_core/Revision.txt @@ -1 +1 @@ -a35505a53981ac0694f16bcae197a65409665e25 \ No newline at end of file +10829 \ No newline at end of file diff --git a/tools/trinity_core/sql/characters_patch.sql b/tools/trinity_core/sql/characters_patch.sql index f6cfc8aa2..c87c27e6b 100644 --- a/tools/trinity_core/sql/characters_patch.sql +++ b/tools/trinity_core/sql/characters_patch.sql @@ -13,6 +13,7 @@ CREATE TABLE `character_feed_log` ( `date` int(11) default NULL, `counter` int(11) NOT NULL, `difficulty` smallint(6) default '-1', + `item_guid` int(11) NOT NULL, PRIMARY KEY (`guid`,`type`,`data`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/tools/trinity_core/sql/update_character_feed_log.sql b/tools/trinity_core/sql/update_character_feed_log.sql new file mode 100644 index 000000000..0a95e5091 --- /dev/null +++ b/tools/trinity_core/sql/update_character_feed_log.sql @@ -0,0 +1 @@ +ALTER TABLE `character_feed_log` ADD `item_guid` INT NOT NULL ; \ No newline at end of file diff --git a/tools/trinity_core/wowarmory_patch.patch b/tools/trinity_core/wowarmory_patch.patch index e1fa5f15a..0fc59a461 100644 --- a/tools/trinity_core/wowarmory_patch.patch +++ b/tools/trinity_core/wowarmory_patch.patch @@ -1,100 +1,147 @@ diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp -@@ -1914,6 +1914,9 @@ - if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement)) +@@ -1965,6 +1965,9 @@ return; + SendAchievementEarned(achievement); + /** World of Warcraft Armory **/ + + GetPlayer()->WriteWowArmoryDatabaseLog(1, achievement->ID); + + /** World of Warcraft Armory **/ - SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); + ca.changed = true; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp -@@ -1030,6 +1030,15 @@ +@@ -1014,6 +1014,15 @@ ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); + /** World of Warcraft Armory **/ + + if (pProto->Quality > 2 && pProto->Flags != 2048 && (pProto->Class == ITEM_CLASS_WEAPON || pProto->Class == ITEM_CLASS_ARMOR) && player) + + { + + std::ostringstream ss; -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u)", player->GetGUIDLow(), item); -+ ss << "REPLACE INTO character_feed_log (guid, type, data, date, counter) VALUES (" << player->GetGUIDLow() << ", 2, " << item << ", UNIX_TIMESTAMP(NOW()), 1)"; + ++ sLog->outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u)", player->GetGUIDLow(), item); + ++ ss << "REPLACE INTO character_feed_log (guid, type, data, date, counter, item_guid) VALUES (" << player->GetGUIDLow() << ", 2, " << item << ", UNIX_TIMESTAMP(NOW()), 1," << pItem->GetGUIDLow() << ")"; + + CharacterDatabase.PExecute( ss.str().c_str() ); + + } + + /** World of Warcraft Armory **/ Item *pItem = NewItemOrBag(pProto); - if (pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player)) + if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp -@@ -17628,6 +17628,17 @@ - +@@ -17892,6 +17892,17 @@ std::string sql_name = m_name; CharacterDatabase.escape_string(sql_name); -+ + + /** World of Warcraft Armory **/ + + std::ostringstream ps; + + ps << "REPLACE INTO armory_character_stats (guid,data) VALUES ('" << GetGUIDLow() << "', '"; + + for(uint16 i = 0; i < m_valuesCount; ++i ) + + { + + ps << GetUInt32Value(i) << " "; + + } + + ps << "')"; + + CharacterDatabase.Execute( ps.str().c_str() ); + + /** World of Warcraft Armory **/ - ++ std::ostringstream ss; ss << "REPLACE INTO characters (guid,account,name,race,class,gender,level,xp,money,playerBytes,playerBytes2,playerFlags," -@@ -24170,3 +24181,33 @@ + "map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, " +@@ -24393,3 +24404,33 @@ return ((float)sum) / count; } + +/** World of Warcraft Armory **/ + +void Player::WriteWowArmoryDatabaseLog(uint32 type, uint32 data) + +{ + + uint32 pGuid = GetGUIDLow(); -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: %u, data: %u", pGuid, type, data); + ++ sLog->outDetail("WoWArmory: write feed log (guid: %u, type: %u, data: %u", pGuid, type, data); + + if (type <= 0) // Unknown type + + { -+ sLog.outError("WoWArmory: unknown type id: %d, ignore.", type); + ++ sLog->outError("WoWArmory: unknown type id: %d, ignore.", type); + + return; + + } + + if (type == 3) // Do not write same bosses many times - just update counter. + + { + + uint8 Difficulty = GetMap()->GetDifficulty(); -+ QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=3 AND data='%u' AND difficulty='%u' LIMIT 1", pGuid, data, Difficulty); + ++ QueryResult result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=3 AND data='%u' AND difficulty='%u' LIMIT 1", pGuid, data, Difficulty); + + if (result) + + { + + CharacterDatabase.PExecute("UPDATE character_feed_log SET counter=counter+1, date=UNIX_TIMESTAMP(NOW()) WHERE guid='%u' AND type=3 AND data='%u' AND difficulty='%u' LIMIT 1", pGuid, data, Difficulty); + + } + + else + + { + + CharacterDatabase.PExecute("INSERT INTO character_feed_log (guid, type, data, date, counter, difficulty) VALUES('%u', '%d', '%u', UNIX_TIMESTAMP(NOW()), 1, '%u')", pGuid, type, data, Difficulty); + + } + + } + + else + + { + + CharacterDatabase.PExecute("REPLACE INTO character_feed_log (guid, type, data, date, counter) VALUES('%u', '%d', '%u', UNIX_TIMESTAMP(NOW()), 1)", pGuid, type, data); + + } + +} + +/** World of Warcraft Armory **/ \ No newline at end of file diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h -@@ -2218,6 +2218,9 @@ +@@ -2235,6 +2235,8 @@ float m_homebindZ; WorldLocation GetStartPosition() const; -+ + /** World of Warcraft Armory **/ + + void WriteWowArmoryDatabaseLog(uint32 type, uint32 data); // currently visible objects at player client @@ -102,16 +149,16 @@ diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp -@@ -15292,4 +15292,5 @@ +@@ -15377,7 +15377,11 @@ if (m->IsRaidOrHeroicDungeon()) { if (creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) +- ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); + { - ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); -@@ -15295,4 +15296,8 @@ - ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); + /** World of Warcraft Armory **/ + + creditedPlayer->WriteWowArmoryDatabaseLog(3, creature->GetCreatureInfo()->Entry); + + /** World of Warcraft Armory **/ + } }