mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[fix] Schedule fixed #68
This commit is contained in:
parent
b8686392e1
commit
86bc55fc1a
@ -20,8 +20,6 @@ class AnchorRaffle extends BaseRaffle
|
||||
const ACTIVE_TITLE = '天选时刻';
|
||||
const ACTIVE_SWITCH = 'USE_ANCHOR';
|
||||
|
||||
use TimeLock;
|
||||
|
||||
protected static $wait_list = [];
|
||||
protected static $finish_list = [];
|
||||
protected static $all_list = [];
|
||||
|
||||
@ -249,6 +249,9 @@ class CapsuleLottery
|
||||
private static function xHeartBeat(int $index = 1): array
|
||||
{
|
||||
$s_data = self::encParamS($index);
|
||||
if (!$s_data) {
|
||||
return ['status' => false];
|
||||
}
|
||||
$s = $s_data['s'];
|
||||
$t = $s_data['payload'];
|
||||
|
||||
@ -284,13 +287,12 @@ class CapsuleLottery
|
||||
return ['status' => true];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @use 加密参数S
|
||||
* @param int $index
|
||||
* @return array
|
||||
* @return array|false
|
||||
*/
|
||||
private static function encParamS(int $index): array
|
||||
private static function encParamS(int $index)
|
||||
{
|
||||
// 转换index
|
||||
$temp = json_decode(self::$hb_payload['id'], true);
|
||||
@ -314,12 +316,16 @@ class CapsuleLottery
|
||||
];
|
||||
$data = Curl::put('other', self::$enc_server, $payload, $headers);
|
||||
$de_raw = json_decode($data, true);
|
||||
Log::info("S参数加密 {$de_raw['s']}");
|
||||
|
||||
return [
|
||||
's' => $de_raw['s'],
|
||||
'payload' => $payload['t']
|
||||
];
|
||||
if ($de_raw['code'] == 0) {
|
||||
Log::info("S加密成功 {$de_raw['s']}");
|
||||
return [
|
||||
's' => $de_raw['s'],
|
||||
'payload' => $payload['t']
|
||||
];
|
||||
} else {
|
||||
Log::warning("S加密成功 {$de_raw['message']}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -20,8 +20,6 @@ class GiftRaffle extends BaseRaffle
|
||||
const ACTIVE_TITLE = '活动礼物';
|
||||
const ACTIVE_SWITCH = 'USE_ACTIVE';
|
||||
|
||||
use TimeLock;
|
||||
|
||||
protected static $wait_list = [];
|
||||
protected static $finish_list = [];
|
||||
protected static $all_list = [];
|
||||
|
||||
@ -20,8 +20,6 @@ class GuardRaffle extends BaseRaffle
|
||||
const ACTIVE_TITLE = '总督舰长';
|
||||
const ACTIVE_SWITCH = 'USE_GUARD';
|
||||
|
||||
use TimeLock;
|
||||
|
||||
protected static $wait_list = [];
|
||||
protected static $finish_list = [];
|
||||
protected static $all_list = [];
|
||||
|
||||
@ -21,8 +21,6 @@ class PkRaffle extends BaseRaffle
|
||||
const ACTIVE_TITLE = '大乱斗';
|
||||
const ACTIVE_SWITCH = 'USE_PK';
|
||||
|
||||
use TimeLock;
|
||||
|
||||
protected static $wait_list = [];
|
||||
protected static $finish_list = [];
|
||||
protected static $all_list = [];
|
||||
|
||||
@ -212,6 +212,9 @@ class SmallHeart
|
||||
private static function xHeartBeat(int $index = 1): array
|
||||
{
|
||||
$s_data = self::encParamS($index);
|
||||
if (!$s_data) {
|
||||
return ['status' => false];
|
||||
}
|
||||
$s = $s_data['s'];
|
||||
$t = $s_data['payload'];
|
||||
|
||||
@ -251,9 +254,9 @@ class SmallHeart
|
||||
/**
|
||||
* @use 加密参数S
|
||||
* @param int $index
|
||||
* @return array
|
||||
* @return array|false
|
||||
*/
|
||||
private static function encParamS(int $index): array
|
||||
private static function encParamS(int $index)
|
||||
{
|
||||
// 转换index
|
||||
$temp = json_decode(self::$hb_payload['id'], true);
|
||||
@ -277,12 +280,16 @@ class SmallHeart
|
||||
];
|
||||
$data = Curl::put('other', self::$enc_server, $payload, $headers);
|
||||
$de_raw = json_decode($data, true);
|
||||
Log::info("S参数加密 {$de_raw['s']}");
|
||||
|
||||
return [
|
||||
's' => $de_raw['s'],
|
||||
'payload' => $payload['t']
|
||||
];
|
||||
if ($de_raw['code'] == 0) {
|
||||
Log::info("S加密成功 {$de_raw['s']}");
|
||||
return [
|
||||
's' => $de_raw['s'],
|
||||
'payload' => $payload['t']
|
||||
];
|
||||
} else {
|
||||
Log::warning("S加密成功 {$de_raw['message']}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -20,8 +20,6 @@ class StormRaffle extends BaseRaffle
|
||||
const ACTIVE_TITLE = '节奏风暴';
|
||||
const ACTIVE_SWITCH = 'USE_STORM';
|
||||
|
||||
use TimeLock;
|
||||
|
||||
protected static $wait_list = [];
|
||||
protected static $finish_list = [];
|
||||
protected static $all_list = [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user