mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 09:30:10 +08:00
[fix] AnchorRaffle
This commit is contained in:
parent
d4d678ce12
commit
0f3569f1f1
@ -16,7 +16,7 @@ use BiliHelper\Util\BaseRaffle;
|
|||||||
|
|
||||||
class AnchorRaffle extends BaseRaffle
|
class AnchorRaffle extends BaseRaffle
|
||||||
{
|
{
|
||||||
const ACTIVE_TITLE = '天选时刻';
|
const ACTIVE_TITLE = '天选之子';
|
||||||
const ACTIVE_SWITCH = 'live_anchor';
|
const ACTIVE_SWITCH = 'live_anchor';
|
||||||
|
|
||||||
protected static $wait_list = [];
|
protected static $wait_list = [];
|
||||||
@ -178,10 +178,11 @@ class AnchorRaffle extends BaseRaffle
|
|||||||
'room_id' => $room_id,
|
'room_id' => $room_id,
|
||||||
'raffle_id' => $de_raw['id'],
|
'raffle_id' => $de_raw['id'],
|
||||||
'raffle_name' => $de_raw['award_name'],
|
'raffle_name' => $de_raw['award_name'],
|
||||||
|
'remarks' => self::ACTIVE_TITLE,
|
||||||
'wait' => time() + mt_rand(5, 25)
|
'wait' => time() + mt_rand(5, 25)
|
||||||
];
|
];
|
||||||
// Statistics::addPushList($data['raffle_name']);
|
// Statistics::addPushList($data['raffle_name']);
|
||||||
Statistics::addPushList("天选之子");
|
Statistics::addPushList(self::ACTIVE_TITLE);
|
||||||
array_push(self::$wait_list, $data);
|
array_push(self::$wait_list, $data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -230,13 +231,13 @@ class AnchorRaffle extends BaseRaffle
|
|||||||
$de_raw = json_decode($content, true);
|
$de_raw = json_decode($content, true);
|
||||||
// {"code":-403,"data":null,"message":"访问被拒绝","msg":"访问被拒绝"}
|
// {"code":-403,"data":null,"message":"访问被拒绝","msg":"访问被拒绝"}
|
||||||
if (isset($de_raw['code']) && $de_raw['code'] == 0) {
|
if (isset($de_raw['code']) && $de_raw['code'] == 0) {
|
||||||
Statistics::addSuccessList($data['raffle_name']);
|
Statistics::addSuccessList(self::ACTIVE_TITLE);
|
||||||
Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . ": 参与抽奖成功~");
|
Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . "-(" . $data['raffle_name'] . "): 参与抽奖成功~");
|
||||||
} elseif (isset($de_raw['msg']) && $de_raw['code'] == -403 && $de_raw['msg'] == '访问被拒绝') {
|
} elseif (isset($de_raw['msg']) && $de_raw['code'] == -403 && $de_raw['msg'] == '访问被拒绝') {
|
||||||
Log::debug("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . ": {$de_raw['message']}");
|
Log::debug("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . "-(" . $data['raffle_name'] . "): {$de_raw['message']}");
|
||||||
self::pauseLock();
|
self::pauseLock();
|
||||||
} else {
|
} else {
|
||||||
Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . ": {$de_raw['message']}");
|
Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . "-(" . $data['raffle_name'] . "): {$de_raw['message']}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,12 @@ abstract class BaseRaffle
|
|||||||
}
|
}
|
||||||
array_push($room_list, $raffle['room_id']);
|
array_push($room_list, $raffle['room_id']);
|
||||||
array_push($raffle_list, $raffle);
|
array_push($raffle_list, $raffle);
|
||||||
Statistics::addJoinList($raffle['raffle_name']);
|
// 有备注要单独处理
|
||||||
|
if (isset($raffle['remarks'])) {
|
||||||
|
Statistics::addJoinList($raffle['remarks']);
|
||||||
|
} else {
|
||||||
|
Statistics::addJoinList($raffle['raffle_name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (count($raffle_list) && count($room_list)) {
|
if (count($raffle_list) && count($room_list)) {
|
||||||
$room_list = array_unique($room_list);
|
$room_list = array_unique($room_list);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user