Skip to content

Commit

Permalink
[426] Remove whitespaces from TC patch
Browse files Browse the repository at this point in the history
  • Loading branch information
duergar85 authored and Shadez committed Dec 27, 2010
1 parent e15877c commit 52389f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
2 changes: 1 addition & 1 deletion includes/revision_nr.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('ARMORY_REVISION', 425);
define('ARMORY_REVISION', 426);
define('DB_VERSION', 'armory_r416');
define('CONFIG_VERSION', '0708201001');
?>
42 changes: 0 additions & 42 deletions tools/trinity_core/wowarmory_patch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/A

SendAchievementEarned(achievement);
+ /** World of Warcraft Armory **/

+ GetPlayer()->WriteWowArmoryDatabaseLog(1, achievement->ID);

+ /** World of Warcraft Armory **/
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
ca.date = time(NULL);
Expand Down Expand Up @@ -40,23 +38,14 @@ diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entiti
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;
Expand All @@ -68,61 +57,33 @@ diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entiti
}
+
+/** 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);

+ 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.

+ {

+ uint8 Difficulty = GetMap()->GetDifficulty();

+ 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
Expand All @@ -133,7 +94,6 @@ diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities

WorldLocation GetStartPosition() const;
+ /** World of Warcraft Armory **/

+ void WriteWowArmoryDatabaseLog(uint32 type, uint32 data);

// currently visible objects at player client
Expand All @@ -148,9 +108,7 @@ diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/U
- ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
+ {
+ /** World of Warcraft Armory **/

+ creditedPlayer->WriteWowArmoryDatabaseLog(3, creature->GetCreatureInfo()->Entry);

+ /** World of Warcraft Armory **/
+ }
}
Expand Down

0 comments on commit 52389f9

Please sign in to comment.