|
@@ -18,11 +18,12 @@ class chctl
|
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
|
-
|
|
|
+ $this->mSpeedtable = [];
|
|
|
}
|
|
|
|
|
|
public function load()
|
|
|
{
|
|
|
+ $this->mSpeedtable = [];
|
|
|
foreach (self::$cache_names as $cache)
|
|
|
{
|
|
|
$quality = $cache['quality'];
|
|
@@ -31,7 +32,8 @@ class chctl
|
|
|
$data = rcache($cache_name,"provider-");
|
|
|
$data = unserialize($data['data']);
|
|
|
|
|
|
- $cfgs = $data ?? [];
|
|
|
+ $cfgs = empty($data) ? [] : $data;
|
|
|
+
|
|
|
foreach ($cfgs as $items)
|
|
|
{
|
|
|
foreach ($items as $item) {
|
|
@@ -52,10 +54,18 @@ class chctl
|
|
|
|
|
|
public function match($names,int $spec, int $card_type,int $quality)
|
|
|
{
|
|
|
+
|
|
|
$ctl_items = [];
|
|
|
- foreach ($names as $name) {
|
|
|
+ foreach ($names as $name)
|
|
|
+ {
|
|
|
$key = $this->prefix($name,$spec,$card_type,$quality);
|
|
|
- $ctl_items[] = $this->mSpeedtable[$key];
|
|
|
+ if(array_key_exists($key,$this->mSpeedtable)) {
|
|
|
+ $ctl_items[] = $this->mSpeedtable[$key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(empty($ctl_items)) {
|
|
|
+ return $names;
|
|
|
}
|
|
|
|
|
|
$usable_items = [];
|