Skip to content

Commit

Permalink
[217] Added some debug messages to achievement-firsts & character-ach…
Browse files Browse the repository at this point in the history
…ievements pages
  • Loading branch information
Shadez committed May 28, 2010
1 parent 464bf74 commit c152c42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion achievement-firsts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 192
* @revision 217
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -44,6 +44,7 @@
$realmName = (isset($_GET['r'])) ? urldecode($_GET['r']) : $armory->currentRealmInfo['name'];
$isRealm = $utils->IsRealm($realmName);
if($isRealm) {
$armory->Log()->writeLog('achievement-firsts.php : realm %s defined', $realmName);
$xml->XMLWriter()->startElement('realmInfo');
$xml->XMLWriter()->writeAttribute('realm', $realmName);
// Get achievements
Expand Down Expand Up @@ -74,9 +75,13 @@
$xml->XMLWriter()->endElement(); //achievement
}
}
else {
$armory->Log()->writeError('achievement-firsts.php : achievement_firsts variable must be in array!');
}
$xml->XMLWriter()->endElement(); //realmInfo
}
else {
$armory->Log()->writeLog('Unable to find any achievement firsts');
$xml->XMLWriter()->startElement('error');
$xml->XMLWriter()->writeAttribute('errCode', 'noData');
$xml->XMLWriter()->endElement(); //error
Expand Down
15 changes: 14 additions & 1 deletion character-achievements.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 208
* @revision 217
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -71,6 +71,7 @@
}
}
if($achievement_category > 0) {
$armory->Log()->writeLog('character-achievements.php : detected category: %d', $achievement_category);
$xml->XMLWriter()->startElement('achievements');
$xml->XMLWriter()->writeAttribute('lang', $armory->_locale);
$xml->XMLWriter()->writeAttribute('requestUrl', 'character-achievements.xml');
Expand Down Expand Up @@ -109,6 +110,9 @@
$xml->XMLWriter()->endElement(); //achievement
}
}
else {
$armory->Log()->writeLog('character-achievements.php : player %d (%s) does not have any completed achievements in %d category', $characters->GetGUID(), $characters->GetName(), $achievement_category);
}
if(isset($achievements_page['incompleted'])) {
foreach($achievements_page['incompleted'] as $achievement) {
if(isset($achievement['display']) && $achievement['display'] == 0) {
Expand All @@ -120,6 +124,9 @@
$xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value);
}
}
else {
$armory->Log()->writeLog('character-achievements.php : achievement[data] not found (player: %d; %s)!', $characters->GetGUID(), $characters->GetName());
}
if(isset($achievement['criteria']) && is_array($achievement['criteria'])) {
foreach($achievement['criteria'] as $criteria) {
$xml->XMLWriter()->startElement('criteria');
Expand All @@ -129,6 +136,9 @@
$xml->XMLWriter()->endElement(); //criteria
}
}
else {
$armory->Log()->writeLog('character-achievements.php : achievement[critera] not found (player: %d; %s)!', $characters->GetGUID(), $characters->GetName());
}
if(isset($achievement['achievement_tree'])) {
foreach($achievement['achievement_tree'] as $achievement_tree) {
$xml->XMLWriter()->startElement('achievement');
Expand All @@ -141,6 +151,9 @@
$xml->XMLWriter()->endElement(); //achievement
}
}
else {
$armory->Log()->writeLog('character-achievements.php : player %d (%s) does not have any incompleted achievements in %d category', $characters->GetGUID(), $characters->GetName(), $achievement_category);
}
$xml->XMLWriter()->endElement(); //category
$xml->XMLWriter()->endElement(); //achievements
$xml_cache_data = $xml->StopXML();
Expand Down

0 comments on commit c152c42

Please sign in to comment.