Patch 9579
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 867f162..fe4fd46 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -21715,5 +21715,33 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask)
break;
}
return NULL;
}
+
+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 a4166be..cb67f1b 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2176,6 +2176,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);
+
+ // WoWArmory
+ void WriteWowArmoryDatabaseLog(uint32 type, uint32 data);
// currently visible objects at player client
ObjectGuidSet m_clientGUIDs;