Jump to content

World of Warcraft Armory


Recommended Posts

I just downloaded the 381 revision, tried to compile it, and unfortunately, like roelv, it fails due to some lines in the Battleground.cpp file. I am using the latest revision of TrinityCore2.

Error C2440: 'delete' : cannot convert from 'QueryResult_AutoPtr' to 'void *'    
File: Battleground.cpp    
Line: 749    
Column:1    
Project: game

Error C2065: 'winner_rating' : undeclared identifier    
File: Battleground.cpp    
Line: 765    
Column: 1    
Project: game

Error C2065: 'loser_rating' : undeclared identifier    
File:Battleground.cpp
Line:    772
Column: 1    
Project: game

Link to comment
Share on other sites

  • Replies 617
  • Created
  • Last Reply

Top Posters In This Topic

well I thought compiling on more cores worked but it doesn't. I get some weird error and thought it was TC related but it works without the arena patch.

[ 86%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/__/game/AI/ScriptedAI/ScriptedSimpleAI.cpp.o
Linking CXX static library libscripts.a
[ 86%] Built target scripts
make: *** [all] Error 2

I saw you mentioned limited support but I hope it was not your last commit ever. Anyway if you don't have time, you don't need to rush it ;)

Link to comment
Share on other sites

---------------------------------------------------------------------

FIX - Patch-Emulator: TrinityCore2

File Target: wowarmory_arena_chart.patch

---------------------------------------------------------------------

[color="Gray"]diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -738,6 +738,47 @@
            SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
            SetArenaMatchmakerRating(winner, winner_matchmaker_rating);
            SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating);
+            /** World of Warcraft Armory **/
+            uint32 maxChartID;
+            QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT MAX(gameid) FROM armory_game_chart");
+            if(!result)
+                maxChartID = 0;
+            else
+            {
+                maxChartID = (*result)[0].GetUInt32();
[color="DarkRed"]+                delete result;[/color]
[color="Green"]+                result.release();[/color]
+            }
+            uint32 gameID = maxChartID+1;
[color="DarkRed"]+            for(BattlegroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)[/color]
[color="Green"]+            for(BattleGroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)[/color]
+            {[color="DarkRed"]
+                Player *plr = sObjectMgr.GetPlayer(itr->first);[/color][color="Green"]
+                Player *plr = objmgr.GetPlayer(itr->first);[/color]
+                if (!plr)
+                    continue;
+                uint32 plTeamID = plr->GetArenaTeamId(winner_arena_team->GetSlot());
+                int changeType;
+                uint32 resultRating;
+                uint32 resultTeamID;
+                int32 ratingChange;
+                if (plTeamID == winner_arena_team->GetId())
+                {
+                    changeType = 1; //win
+                    resultRating = winner_rating;
+                    resultTeamID = plTeamID;
+                    ratingChange = winner_change;
+                }
+                else
+                {
+                    changeType = 2; //lose
+                    resultRating = loser_rating;
+                    resultTeamID = loser_arena_team->GetId();
+                    ratingChange = loser_change;
+                }
+                std::ostringstream sql_query;
+                //                                                        gameid,              teamid,                     guid,                    changeType,             ratingChange,               teamRating,                  damageDone,                          deaths,                          healingDone,                           damageTaken,                           healingTaken,                         killingBlows,                      mapId,                 start,                   end
+                sql_query << "INSERT INTO armory_game_chart VALUES
('" << gameID << "', '" << resultTeamID << "', '" << plr->GetGUID() << "', '" << changeType << "', '" << ratingChange  << "', '" << resultRating << "', '" << itr->second->DamageDone << "', '" << itr->second->Deaths << "', '" << itr->second->HealingDone << "', '" << itr->second->DamageTaken << "', '" << itr->second->HealingTaken << "', '" << itr->second->KillingBlows << "', '" << m_MapId << "', '" << m_StartTime << "', '" << m_EndTime << "')";
+                CharacterDatabase.Execute(sql_query.str().c_str());
+            }
+            /** World of Warcraft Armory **/
            sLog.outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. RatingChange: %i.", m_ArenaType, m_ArenaTeamIds[bG_TEAM_ALLIANCE], m_ArenaTeamIds[bG_TEAM_HORDE], winner_arena_team->GetId(), winner_change);
        }
        else
@@ -1344,6 +1385,14 @@
        case SCORE_HEALING_DONE:                            // Healing Done
            itr->second->HealingDone += value;
            break;
+        /** World of Warcraft Armory **/
+        case SCORE_DAMAGE_TAKEN:
+            itr->second->DamageTaken += value;              // Damage Taken
+            break;
+        case SCORE_HEALING_TAKEN:
+            itr->second->HealingTaken += value;             // Healing Taken
+            break;
+        /** World of Warcraft Armory **/
        default:
            sLog.outError("Battleground: Unknown player score type %u", type);
            break;
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -210,7 +210,11 @@
    SCORE_SECONDARY_OBJECTIVES  = 17,
    //SOTA
    SCORE_DESTROYED_DEMOLISHER  = 18,
-    SCORE_DESTROYED_WALL        = 19
+    SCORE_DESTROYED_WALL        = 19,
+    /** World of Warcraft Armory **/
+    SCORE_DAMAGE_TAKEN          = 20,
+    SCORE_HEALING_TAKEN         = 21
+    /** World of Warcraft Armory **/
};

enum ArenaType
@@ -302,6 +306,10 @@
        uint32 BonusHonor;
        uint32 DamageDone;
        uint32 HealingDone;
+        /** World of Warcraft Armory **/
+        uint32 DamageTaken;
+        uint32 HealingTaken;
+        /** World of Warcraft Armory **/
};

enum BGHonorMode
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
@@ -693,6 +693,10 @@
            {
                // FIXME: kept by compatibility. don't know in BG if the restriction apply.
                bg->UpdatePlayerScore(killer, SCORE_DAMAGE_DONE, damage);
+                /** World of Warcraft Armory **/
[color="DarkRed"]+                if (Battleground *bgV = ((Player*)pVictim)->GetBattleground())[/color]
[color="Green"]+                if (BattleGround *bgV = ((Player*)pVictim)->GetBattleGround())[/color]
+                    bgV->UpdatePlayerScore(((Player*)pVictim), SCORE_DAMAGE_TAKEN, damage);
+                /** World of Warcraft Armory **/
            }
        }

@@ -9939,6 +9943,10 @@
    {
        pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
        pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
+        /** World of Warcraft Armory **/
[color="DarkRed"]+        if (Battleground *bgV = pVictim->ToPlayer()->GetBattleground())[/color]
[color="Green"]+        if (BattleGround *bgV = pVictim->ToPlayer()->GetBattleGround())[/color]
+            bgV->UpdatePlayerScore((Player*)pVictim, SCORE_HEALING_TAKEN, gain);
+        /** World of Warcraft Armory **/
    }

    return gain;
[/color]

Try...

Link to comment
Share on other sites

Like I said TC rev 9708 didn't compile for me with the arena patch but it compiled fine without the patch. I think rev 9631 did the changes which made the patch not compatible although Shadez updated it. I hope someone else can also test this and if it's only on Linux or also on Windows. If I didn't mention yet, I am using Ubuntu x64.

Link to comment
Share on other sites

Complied fine TC2 rev. 9709 with these changes:

+            else
+            {
+                maxChartID = (*result)[0].GetUInt32();
[color=Red]-                delete result;[/color]
[color=SeaGreen]+                result.release();[/color]
+            }



+                if (plTeamID == winner_arena_team->GetId())
+                {
+                    changeType = 1; //win
[color=Red]-                    [/color][color=Red]resultRating = winner_rating;[/color]
[color=SeaGreen]+                    resultRating = winner_team_rating;[/color]
+                    resultTeamID = plTeamID;
+                    ratingChange = winner_change;
+                }
+                else
+                {
+                    changeType = 2; //lose
[color=Red]-                    resultRating = loser_rating;[/color]
[color=SeaGreen]+                    resultRating = loser_team_rating;[/color]
+                    resultTeamID = loser_arena_team->GetId();
+                    ratingChange = loser_change;
+                }

Link to comment
Share on other sites

It looks like most everything is working! Looks great, although I did find a few things: the Statistics tab on the character view screen doesn't contain any info, I get the XML parsing error, which tells me that there is no info to display. I get this error in debug log.

 Characters::BuildCharacter : player 1 (Burrfoot) does not have any data in `armory_character_stats` table (SQL update to characters DB not applied?)

The thing is, the update WAS applied...when looking through the update provided in the Tools folder for trinity, I found no reference to the table mentioned in the error.

Also, not all 3d models will display. I'm assuming it's because there are missing textures. Is there anyway to get my hands on updated textures?

The calendar returns an error saying that not all data could be loaded, and to try again in a few minutes. I read through the debug log but didn't find anything in reference to the calendar issue.

When I looked at my server console, I noticed that this error kept popping up:

query ERROR: Table 'characters.character_arena_stats' doesn't exit
SQL: SELECT personal_rating, matchmaker_rating FROM character_arena_stats WHERE
guid='1' AND slot='2'

Is it something I need to worry about?

All in all, a VERY well done project! Thanks a lot!

Link to comment
Share on other sites

Complied fine TC2 rev. 9709 with these changes:

+            else
+            {
+                maxChartID = (*result)[0].GetUInt32();
[color=Red]-                delete result;[/color]
[color=SeaGreen]+                result.release();[/color]
+            }



+                if (plTeamID == winner_arena_team->GetId())
+                {
+                    changeType = 1; //win
[color=Red]-                    [/color][color=Red]resultRating = winner_rating;[/color]
[color=SeaGreen]+                    resultRating = winner_team_rating;[/color]
+                    resultTeamID = plTeamID;
+                    ratingChange = winner_change;
+                }
+                else
+                {
+                    changeType = 2; //lose
[color=Red]-                    resultRating = loser_rating;[/color]
[color=SeaGreen]+                    resultRating = loser_team_rating;[/color]
+                    resultTeamID = loser_arena_team->GetId();
+                    ratingChange = loser_change;
+                }

This did the trick, compiled fine on single and mutli core, thank you!

Link to comment
Share on other sites

It looks like most everything is working! Looks great, although I did find a few things: the Statistics tab on the character view screen doesn't contain any info, I get the XML parsing error, which tells me that there is no info to display. I get this error in debug log.

 Characters::BuildCharacter : player 1 (Burrfoot) does not have any data in `armory_character_stats` table (SQL update to characters DB not applied?)

The thing is, the update WAS applied...when looking through the update provided in the Tools folder for trinity, I found no reference to the table mentioned in the error.

Don`t forget to apply the tools/trinity_core/characters_patch.sql to characters DB.

This did the trick, compiled fine on single and mutli core, thank you!

Your welcome!

Link to comment
Share on other sites

Hi everybody, sorry for my english : i'm french =)

So today, i test to apply patch to my mangos core (10430) :

git apply --check ../wow_armory_patches_10116.patch

And i get :

fatal: corrupt patch at line 235

I'm noob, and i want to know if my method is correct ? Or just if patch is not made for my core version ?

Thanks for your attention (and your very great work !) =)

Link to comment
Share on other sites

Don`t forget to apply the tools/trinity_core/characters_patch.sql to characters DB.

Thanks for the help, but if you read my comment completely, you'll see that the patch WAS applied to the characters database. This is the character database update that is provided in the tools directory:

DROP TABLE IF EXISTS `armory_character_stats`;
CREATE TABLE `armory_character_stats` (
 `guid` int(11) NOT NULL,
 `data` longtext NOT NULL,
 PRIMARY KEY  (`guid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='World of Warcraft Armory table';

DROP TABLE IF EXISTS `character_feed_log`;
CREATE TABLE `character_feed_log` (
 `guid` int(11) NOT NULL,
 `type` smallint(1) NOT NULL,
 `data` int(11) NOT NULL,
 `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 `counter` int(11) NOT NULL,
 PRIMARY KEY  (`guid`,`type`,`data`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `armory_game_chart`;
CREATE TABLE `armory_game_chart` (
 `gameid` int(11) NOT NULL,
 `teamid` int(11) NOT NULL,
 `guid` int(11) NOT NULL,
 `changeType` int(11) NOT NULL,
 `ratingChange` int(11) NOT NULL,
 `teamRating` int(11) NOT NULL,
 `damageDone` int(11) NOT NULL,
 `deaths` int(11) NOT NULL,
 `healingDone` int(11) NOT NULL,
 `damageTaken` int(11) NOT NULL,
 `healingTaken` int(11) NOT NULL,
 `killingBlows` int(11) NOT NULL,
 `mapId` int(11) NOT NULL,
 `start` int(11) NOT NULL,
 `end` int(11) NOT NULL,
 PRIMARY KEY  (`gameid`,`teamid`,`guid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='WoWArmory Game Chart';

Nowhere in there is a character_arena_stats table created.

Link to comment
Share on other sites

Hey, I have read many times the installation file and the post on mangos forum but I can't find my problem.

*/armory/character-sheet.xml?r=Armory+Realm&cn=Phoenix

*/armory/search.xml?source=all&type=armor&subTp=cloth&searchType=items

Everything with search don't work, en you can't see a profile of a char of search it.

If you login I can see me charlist, but I can't go to a specific char.

Any idea ? I used the version of last week with MaNGOS and database is okay, he see my chars etc and all SQL done in SQL map for armory.

Thanks

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use