[fix] SmallHeart

This commit is contained in:
Lkeme 2020-11-17 19:36:03 +08:00
parent f1a414368e
commit e0cfec5aaa
10 changed files with 549 additions and 288 deletions

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ config
Traits/ Traits/
README1.md README1.md
conf/user.conf conf/user.conf
conf/user1.conf
/conf/user.conf /conf/user.conf
/conf/test.conf /conf/test.conf
/log/ /log/

View File

@ -1,6 +1,22 @@
# Release Notes # Release Notes
# 本项目Log # 本项目Log
## v0.6.7.201117 alpha (2020-11-17)
### Added
-
### Changed
- 调整WS读取数据大小
- 调整弹幕发送时间
- 更新天选之子日志打印
- 更新基础库
-
### Fixed
- 修复小心心心跳错误
-
## v0.6.5.200808 alpha (2020-08-08) ## v0.6.5.200808 alpha (2020-08-08)
### Added ### Added

2
DOC.md
View File

@ -2,7 +2,7 @@
<p align="center"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p> <p align="center"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>
<p align="center"> <p align="center">
<img src="https://img.shields.io/badge/version-0.6.5.200808 alpha-green.svg?longCache=true&style=for-the-badge"> <img src="https://img.shields.io/badge/version-0.6.7.201117 alpha-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/license-mit-blue.svg?longCache=true&style=for-the-badge"> <img src="https://img.shields.io/badge/license-mit-blue.svg?longCache=true&style=for-the-badge">
</p> </p>

View File

@ -7,7 +7,7 @@ Group: [55308141](https://jq.qq.com/?_wv=1027&k=5AIDaJg) | **仅用于BUG提交
## 公告 ## 公告
> Currently for Personal Edition **0.6.5.200808 alpha** > Currently for Personal Edition **0.6.7.201117 alpha**
```notice ```notice
---- 免费的东西总是得不到人的珍惜。 ---- 免费的东西总是得不到人的珍惜。

795
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ namespace BiliHelper\Core;
class Env class Env
{ {
private $app_name = 'BiliHelper Personal'; private $app_name = 'BiliHelper Personal';
private $app_version = '0.6.5.*'; private $app_version = '0.6.7.*';
/** /**
* Env constructor. * Env constructor.

View File

@ -200,7 +200,8 @@ class AnchorRaffle extends BaseRaffle
'raffle_name' => $de_raw['award_name'], 'raffle_name' => $de_raw['award_name'],
'wait' => time() + mt_rand(5, 25) 'wait' => time() + mt_rand(5, 25)
]; ];
Statistics::addPushList($data['raffle_name']); // Statistics::addPushList($data['raffle_name']);
Statistics::addPushList("天选之子");
array_push(self::$wait_list, $data); array_push(self::$wait_list, $data);
return true; return true;
} }

View File

@ -33,7 +33,7 @@ class Barrage
]; ];
if (self::privateSendMsg($info)) { if (self::privateSendMsg($info)) {
self::setLock(mt_rand(20, 40) * 60); self::setLock(mt_rand(40, 60) * 60);
return; return;
} }

View File

@ -33,6 +33,8 @@ class SmallHeart
private static $metal_lock = 0; // 勋章时间锁 private static $metal_lock = 0; // 勋章时间锁
private static $heartbeat_interval = 60; // 每次跳动时间
public static function run() public static function run()
{ {
if (!self::init()) { if (!self::init()) {
@ -45,11 +47,11 @@ class SmallHeart
} }
if (self::getLock() < time()) { if (self::getLock() < time()) {
self::heartBeat(); self::heartBeat();
if (self::$hb_count >= 30) { if (self::$hb_count >= 200) {
self::resetVar(); self::resetVar();
self::setLock(self::timing(2)); self::setLock(self::timing(2));
} else { } else {
self::setLock(5 * 60); self::setLock(self::$heartbeat_interval);
} }
} }
} }
@ -64,6 +66,8 @@ class SmallHeart
self::$hb_count = 0; // 心跳次数 max 24 self::$hb_count = 0; // 心跳次数 max 24
self::$hb_room_info = []; // 心跳带勋章房间信息 self::$hb_room_info = []; // 心跳带勋章房间信息
self::$heartbeat_interval = 60; // 跳变时间
} }
/** /**
@ -185,6 +189,8 @@ class SmallHeart
$payload['secret_key'] = $de_raw['data']['secret_key']; $payload['secret_key'] = $de_raw['data']['secret_key'];
$payload['heartbeat_interval'] = $de_raw['data']['heartbeat_interval']; $payload['heartbeat_interval'] = $de_raw['data']['heartbeat_interval'];
$payload['secret_rule'] = $de_raw['data']['secret_rule']; $payload['secret_rule'] = $de_raw['data']['secret_rule'];
// 自动跳变时间
self::$heartbeat_interval = $de_raw['data']['heartbeat_interval'];
return [ return [
'status' => true, 'status' => true,
'payload' => $payload, 'payload' => $payload,
@ -229,6 +235,8 @@ class SmallHeart
self::$hb_payload['ets'] = $de_raw['data']['timestamp']; self::$hb_payload['ets'] = $de_raw['data']['timestamp'];
self::$hb_payload['secret_key'] = $de_raw['data']['secret_key']; self::$hb_payload['secret_key'] = $de_raw['data']['secret_key'];
self::$hb_payload['heartbeat_interval'] = $de_raw['data']['heartbeat_interval']; self::$hb_payload['heartbeat_interval'] = $de_raw['data']['heartbeat_interval'];
// 自动跳变时间
self::$heartbeat_interval = $de_raw['data']['heartbeat_interval'];
Log::info("小心心礼物X-{$index}心跳成功"); Log::info("小心心礼物X-{$index}心跳成功");
return ['status' => true]; return ['status' => true];
} }

View File

@ -595,7 +595,7 @@ class ZoneTcpClient
$data = gzuncompress($bin); $data = gzuncompress($bin);
$total = strlen($data); $total = strlen($data);
while (true) { while (true) {
if ($step > 65535) { if ($step > 165535) {
Log::warning("v2_split: 数据step异常 {$step}"); Log::warning("v2_split: 数据step异常 {$step}");
break; break;
}; };