Util/Realms

* check for accessibility
 * use for achievements/realm firsts
This commit is contained in:
Sarjuuk
2015-08-30 13:47:42 +02:00
parent 645894fdbf
commit 58babe24fe
3 changed files with 24 additions and 18 deletions

View File

@@ -103,14 +103,9 @@ class AchievementPage extends GenericPage
if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH))
{
$avlb = [];
foreach (DB::Auth()->selectCol('SELECT id AS ARRAY_KEY, name FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_BUILD) AS $rId => $name)
{
if (!DB::isConnectable(DB_CHARACTERS . $rId))
continue;
foreach (Util::getRealms() AS $rId => $rData)
if (!DB::Characters($rId)->selectCell('SELECT 1 FROM character_achievement WHERE achievement = ?d LIMIT 1', $this->typeId))
$avlb[] = Util::ucWords($name);
}
$avlb[] = Util::ucWords($rData['name']);
if ($avlb)
$infobox[] = Lang::achievement('rfAvailable').implode(', ', $avlb);