diff --git a/tools/character_feed/wowarmory_feed_9519.patch b/tools/character_feed/wowarmory_feed_9519.patch deleted file mode 100644 index 719921485..000000000 --- a/tools/character_feed/wowarmory_feed_9519.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp -index 0c27304..c65ff84 100644 ---- a/src/game/AchievementMgr.cpp -+++ b/src/game/AchievementMgr.cpp -@@ -1776,6 +1776,8 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, - void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) - { - sLog.outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); -+ /* WoWArmory Feed Log */ -+ GetPlayer()->WriteWowArmoryDatabaseLog(1, achievement->ID); - if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end()) - return; - -diff --git a/src/game/Item.cpp b/src/game/Item.cpp -index b460b57..7fa5153 100644 ---- a/src/game/Item.cpp -+++ b/src/game/Item.cpp -@@ -953,6 +953,24 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player ) - if ( count > pProto->GetMaxStackSize()) - count = pProto->GetMaxStackSize(); - -+ if (pProto->Quality > 2 && pProto->Flags != 2048 && (pProto->Class == ITEM_CLASS_WEAPON || pProto->Class == ITEM_CLASS_ARMOR) && player) -+ { -+ /* WoWArmory Feed Log */ -+ std::ostringstream ss; -+ QueryResult *result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=2 AND data='%u' LIMIT 1", player->GetGUIDLow(), item); -+ if(result) -+ { -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); -+ ss << "UPDATE character_feed_log SET counter=counter+1, date=NOW() WHERE guid=" << player->GetGUIDLow() << " AND type=2 AND data=" << item << " LIMIT 1"; -+ CharacterDatabase.PExecute( ss.str().c_str() ); -+ } -+ else -+ { -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); -+ ss << "INSERT INTO character_feed_log (guid, type, data, counter) VALUES (" << player->GetGUIDLow() << ", 2, " << item << ", 1)"; -+ CharacterDatabase.PExecute( ss.str().c_str() ); -+ } -+ delete result; -+ } - assert(count !=0 && "pProto->Stackable==0 but checked at loading already"); - - Item *pItem = NewItemOrBag( pProto ); -diff --git a/src/game/Player.cpp b/src/game/Player.cpp -index 893b803..f37ccd3 100644 ---- a/src/game/Player.cpp -+++ b/src/game/Player.cpp -@@ -21688,4 +21688,29 @@ void Player::SetHomebindToLocation(WorldLocation const& loc, uint32 area_id) - m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow()); - } - -- -+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); -+ if (type <= 0) // Unknown type -+ { -+ sLog.outError("WoWArmory: unknown type id: %d, ignore.", type); -+ return; -+ } -+ if (type == 3) // Do not write same bosses many times - just update counter. -+ { -+ QueryResult *result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=3 AND data='%u' LIMIT 1", pGuid, data); -+ if (result) -+ { -+ CharacterDatabase.PExecute("UPDATE character_feed_log SET counter=counter+1, date=NOW() WHERE guid='%u' AND type=3 AND data='%u' LIMIT 1", pGuid, data); -+ } -+ else -+ { -+ CharacterDatabase.PExecute("INSERT INTO character_feed_log (guid, type, data, counter) VALUES('%u', %d, '%u', 1)", pGuid, type, data); -+ } -+ delete result; -+ } -+ else -+ { -+ CharacterDatabase.PExecute("INSERT IGNORE INTO character_feed_log (guid, type, data, counter) VALUES('%u', %d, '%u', 1)", pGuid, type, data); -+ } -+} -diff --git a/src/game/Player.h b/src/game/Player.h -index 3de8ea8..0998ca2 100644 ---- a/src/game/Player.h -+++ b/src/game/Player.h -@@ -2174,6 +2174,9 @@ class MANGOS_DLL_SPEC Player : public Unit - void SetHomebindToLocation(WorldLocation const& loc, uint32 area_id); - void RelocateToHomebind() { SetLocationMapId(m_homebindMapId); Relocate(m_homebindX, m_homebindY, m_homebindZ); } - bool TeleportToHomebind(uint32 options = 0) { return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation(), options); } -+ -+ // WoWArmory -+ void WriteWowArmoryDatabaseLog(uint32 type, uint32 data); - - // currently visible objects at player client - typedef std::set ClientGUIDs; -diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp -index 4a9f340..313075e 100644 ---- a/src/game/Unit.cpp -+++ b/src/game/Unit.cpp -@@ -866,8 +866,12 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa - { - if (m->IsRaidOrHeroicDungeon()) - { -- if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) -- ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); -+ if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) -+ { -+ ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); -+ /* WoWArmory Feed Log */ -+ player->WriteWowArmoryDatabaseLog(3, cVictim->GetCreatureInfo()->Entry); -+ } - } - else - { diff --git a/tools/character_feed/wowarmory_feed_9578.patch b/tools/character_feed/wowarmory_feed_9611.patch similarity index 62% rename from tools/character_feed/wowarmory_feed_9578.patch rename to tools/character_feed/wowarmory_feed_9611.patch index 64bd6620e..2aa61b8eb 100644 --- a/tools/character_feed/wowarmory_feed_9578.patch +++ b/tools/character_feed/wowarmory_feed_9611.patch @@ -1,8 +1,8 @@ diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp -index d682be5..bfa2045 100644 +index 5a61c4e..2da6f40 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp -@@ -1778,6 +1778,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) +@@ -1782,6 +1782,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) sLog.outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end()) return; @@ -12,47 +12,44 @@ index d682be5..bfa2045 100644 SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; diff --git a/src/game/Item.cpp b/src/game/Item.cpp -index 235f4a5..f3426ed 100644 +index 235f4a5..d679616 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp -@@ -945,8 +945,27 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player ) - { +@@ -946,6 +946,25 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player ) if ( count > pProto->GetMaxStackSize()) count = pProto->GetMaxStackSize(); -- -- assert(count !=0 && "pProto->Stackable==0 but checked at loading already"); -+ -+ if (pProto->Quality > 2 && pProto->Flags != 2048 && (pProto->Class == ITEM_CLASS_WEAPON || pProto->Class == ITEM_CLASS_ARMOR) && player) + ++ if (pProto->Quality > 2 && pProto->Flags != 2048 && (pProto->Class == ITEM_CLASS_WEAPON || pProto->Class == ITEM_CLASS_ARMOR) && player) + { -+ /* WoWArmory Feed Log */ -+ std::ostringstream ss; -+ QueryResult *result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=2 AND data='%u' LIMIT 1", player->GetGUIDLow(), item); -+ if(result) -+ { -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); -+ ss << "UPDATE character_feed_log SET counter=counter+1, date=NOW() WHERE guid=" << player->GetGUIDLow() << " AND type=2 AND data=" << item << " LIMIT 1"; -+ CharacterDatabase.PExecute( ss.str().c_str() ); -+ } -+ else -+ { -+ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); -+ ss << "INSERT INTO character_feed_log (guid, type, data, counter) VALUES (" << player->GetGUIDLow() << ", 2, " << item << ", 1)"; -+ CharacterDatabase.PExecute( ss.str().c_str() ); -+ } -+ delete result; -+ } -+ assert(count !=0 && "pProto->Stackable==0 but checked at loading already"); ++ /* WoWArmory Feed Log */ ++ std::ostringstream ss; ++ QueryResult *result = CharacterDatabase.PQuery("SELECT counter FROM character_feed_log WHERE guid='%u' AND type=2 AND data='%u' LIMIT 1", player->GetGUIDLow(), item); ++ if(result) ++ { ++ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); ++ ss << "UPDATE character_feed_log SET counter=counter+1, date=NOW() WHERE guid=" << player->GetGUIDLow() << " AND type=2 AND data=" << item << " LIMIT 1"; ++ CharacterDatabase.PExecute( ss.str().c_str() ); ++ } ++ else ++ { ++ sLog.outDetail("WoWArmory: write feed log (guid: %u, type: 2, data: %u", player->GetGUIDLow(), item); ++ ss << "INSERT INTO character_feed_log (guid, type, data, counter) VALUES (" << player->GetGUIDLow() << ", 2, " << item << ", 1)"; ++ CharacterDatabase.PExecute( ss.str().c_str() ); ++ } ++ delete result; ++ } + assert(count !=0 && "pProto->Stackable==0 but checked at loading already"); Item *pItem = NewItemOrBag( pProto ); - if( pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) ) diff --git a/src/game/Player.cpp b/src/game/Player.cpp -index 867f162..fe4fd46 100644 +index aa65246..1153fe0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp -@@ -21720,3 +21720,31 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask) - - return NULL; - } +@@ -21722,4 +21722,32 @@ void Player::SetRestType( RestType n_r_type, uint32 areaTriggerId /*= 0*/) + if(sWorld.IsFFAPvPRealm()) + SetFFAPvP(false); + } ++} + +void Player::WriteWowArmoryDatabaseLog(uint32 type, uint32 data) +{ @@ -80,12 +77,13 @@ index 867f162..fe4fd46 100644 + { + CharacterDatabase.PExecute("INSERT IGNORE INTO character_feed_log (guid, type, data, counter) VALUES('%u', %d, '%u', 1)", pGuid, type, data); + } -+} + } +\ No newline at end of file diff --git a/src/game/Player.h b/src/game/Player.h -index a4166be..6e7bcb1 100644 +index e381363..e2acd79 100644 --- a/src/game/Player.h +++ b/src/game/Player.h -@@ -2176,6 +2176,9 @@ class MANGOS_DLL_SPEC Player : public Unit +@@ -2162,6 +2162,9 @@ class MANGOS_DLL_SPEC Player : public Unit bool TeleportToHomebind(uint32 options = 0) { return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation(), options); } Object* GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask); @@ -94,17 +92,17 @@ index a4166be..6e7bcb1 100644 + void WriteWowArmoryDatabaseLog(uint32 type, uint32 data); // currently visible objects at player client - typedef std::set ClientGUIDs; + ObjectGuidSet m_clientGUIDs; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp -index b13fd3a..a8c1797 100644 +index b9af5d0..a639cdd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp -@@ -832,7 +832,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa +@@ -833,7 +833,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (m->IsRaidOrHeroicDungeon()) { if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) - ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); -+ { ++ { + ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer); + /* WoWArmory Feed Log */ + player->WriteWowArmoryDatabaseLog(3, cVictim->GetCreatureInfo()->Entry);