Skip to content

Commit

Permalink
[121] Character feed patch updated to 9611 MaNGOS revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Mar 22, 2010
1 parent 6babcd7 commit e90910f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 152 deletions.
112 changes: 0 additions & 112 deletions tools/character_feed/wowarmory_feed_9519.patch

This file was deleted.

@@ -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;
Expand All @@ -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)
+{
Expand Down Expand Up @@ -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);
Expand All @@ -94,17 +92,17 @@ index a4166be..6e7bcb1 100644
+ void WriteWowArmoryDatabaseLog(uint32 type, uint32 data);

// currently visible objects at player client
typedef std::set<ObjectGuid> 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);
Expand Down

0 comments on commit e90910f

Please sign in to comment.