$room_id, 'raffle_id' => $guard['id'], 'raffle_name' => $raffle_name, 'wait' => time() ]; Statistics::addPushList(self::ACTIVE_TITLE); array_push(self::$wait_list, $data); } return true; } /** * @use 请求抽奖 * @param array $data * @return bool */ protected static function lottery(array $data): bool { $user_info = User::parseCookies(); $payload = [ 'id' => $data['raffle_id'], 'roomid' => $data['room_id'], "type" => "guard", 'csrf_token' => $user_info['token'], 'csrf' => $user_info['token'] ]; $url = 'https://api.live.bilibili.com/lottery/v2/lottery/join'; $raw = Curl::post($url, Sign::api($payload)); $de_raw = json_decode($raw, true); if (isset($de_raw['code']) && $de_raw['code'] == 0) { Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . ": {$de_raw['data']['message']}"); Statistics::addSuccessList(self::ACTIVE_TITLE); } else { Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . self::ACTIVE_TITLE . ": {$de_raw['msg']}"); } return true; } }