diff --git a/src/plugin/AnchorRaffle.php b/src/plugin/AnchorRaffle.php index 234a5c6..5d44579 100644 --- a/src/plugin/AnchorRaffle.php +++ b/src/plugin/AnchorRaffle.php @@ -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 = []; diff --git a/src/plugin/CapsuleLottery.php b/src/plugin/CapsuleLottery.php index 1720ae3..382d30a 100644 --- a/src/plugin/CapsuleLottery.php +++ b/src/plugin/CapsuleLottery.php @@ -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; + } } /** diff --git a/src/plugin/GiftRaffle.php b/src/plugin/GiftRaffle.php index ade607d..72fc944 100644 --- a/src/plugin/GiftRaffle.php +++ b/src/plugin/GiftRaffle.php @@ -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 = []; diff --git a/src/plugin/GuardRaffle.php b/src/plugin/GuardRaffle.php index 6ec629a..c9cc437 100644 --- a/src/plugin/GuardRaffle.php +++ b/src/plugin/GuardRaffle.php @@ -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 = []; diff --git a/src/plugin/PkRaffle.php b/src/plugin/PkRaffle.php index 17d6fb7..3cce163 100644 --- a/src/plugin/PkRaffle.php +++ b/src/plugin/PkRaffle.php @@ -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 = []; diff --git a/src/plugin/SmallHeart.php b/src/plugin/SmallHeart.php index fae39ac..03ec0ab 100644 --- a/src/plugin/SmallHeart.php +++ b/src/plugin/SmallHeart.php @@ -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; + } } diff --git a/src/plugin/StormRaffle.php b/src/plugin/StormRaffle.php index e1a86f2..ab239f1 100644 --- a/src/plugin/StormRaffle.php +++ b/src/plugin/StormRaffle.php @@ -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 = [];