mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Profiler/Misc
* fix realm selection in profiler filters * minor cleanup of prQueue
This commit is contained in:
@@ -46,6 +46,8 @@ class ArenaTeamList extends BaseType
|
||||
|
||||
class ArenaTeamListFilter extends Filter
|
||||
{
|
||||
use TrProfilerFilter;
|
||||
|
||||
public $extraOpts = [];
|
||||
protected $genericFilter = [];
|
||||
|
||||
@@ -86,33 +88,6 @@ class ArenaTeamListFilter extends Filter
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbRegionCheck(string &$v) : bool
|
||||
{
|
||||
if (in_array($v, Util::$regions))
|
||||
{
|
||||
$this->parentCats[0] = $v; // directly redirect onto this region
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbServerCheck(string &$v) : bool
|
||||
{
|
||||
foreach (Profiler::getRealms() as $realm)
|
||||
if ($realm['name'] == $v)
|
||||
{
|
||||
$this->parentCats[1] = Profiler::urlize($v);// directly redirect onto this server
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -918,6 +918,37 @@ trait sourceHelper
|
||||
}
|
||||
}
|
||||
|
||||
trait TrProfilerFilter
|
||||
{
|
||||
protected function cbRegionCheck(string &$v) : bool
|
||||
{
|
||||
if (in_array($v, Util::$regions))
|
||||
{
|
||||
$this->parentCats[0] = $v; // directly redirect onto this region
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbServerCheck(string &$v) : bool
|
||||
{
|
||||
foreach (Profiler::getRealms() as $realm)
|
||||
{
|
||||
if (Profiler::urlize($realm['name']) != $v)
|
||||
continue;
|
||||
|
||||
$this->parentCats[1] = $v; // directly redirect onto this server
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Filter
|
||||
{
|
||||
|
||||
@@ -89,6 +89,8 @@ class GuildList extends BaseType
|
||||
|
||||
class GuildListFilter extends Filter
|
||||
{
|
||||
use TrProfilerFilter;
|
||||
|
||||
public $extraOpts = [];
|
||||
protected $genericFilter = [];
|
||||
|
||||
@@ -124,33 +126,6 @@ class GuildListFilter extends Filter
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbRegionCheck(string &$v) : bool
|
||||
{
|
||||
if (in_array($v, Util::$regions))
|
||||
{
|
||||
$this->parentCats[0] = $v; // directly redirect onto this region
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbServerCheck(string &$v) : bool
|
||||
{
|
||||
foreach (Profiler::getRealms() as $realm)
|
||||
if ($realm['name'] == $v)
|
||||
{
|
||||
$this->parentCats[1] = Profiler::urlize($v);// directly redirect onto this server
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -239,6 +239,8 @@ class ProfileList extends BaseType
|
||||
|
||||
class ProfileListFilter extends Filter
|
||||
{
|
||||
use TrProfilerFilter;
|
||||
|
||||
public $useLocalList = false;
|
||||
public $extraOpts = [];
|
||||
|
||||
@@ -359,33 +361,6 @@ class ProfileListFilter extends Filter
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbRegionCheck(string &$v) : bool
|
||||
{
|
||||
if (in_array($v, Util::$regions))
|
||||
{
|
||||
$this->parentCats[0] = $v; // directly redirect onto this region
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbServerCheck(string &$v) : bool
|
||||
{
|
||||
foreach (Profiler::getRealms() as $realm)
|
||||
if ($realm['name'] == $v)
|
||||
{
|
||||
$this->parentCats[1] = Profiler::urlize($v);// directly redirect onto this server
|
||||
$v = ''; // remove from filter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbProfession(int $cr, int $crs, string $crv, $skillId) : ?array
|
||||
{
|
||||
if (!Util::checkNumeric($crv, NUM_CAST_INT) || !$this->int2Op($crs))
|
||||
|
||||
Reference in New Issue
Block a user