[add] Match

This commit is contained in:
lkeme 2020-04-26 20:07:31 +08:00
parent 695105ca8f
commit c1481438c9
10 changed files with 695 additions and 52 deletions

View File

@ -1,6 +1,19 @@
# Release Notes
# 本项目Log
## v0.4.0.200426 alpha (2020-04-26)
### Added
- 赛事助手 (签到、分享)
-
### Changed
-
### Fixed
- 修复休眠机制
-
## v0.3.0.200425 alpha (2020-04-25)
### Added

51
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 src="https://img.shields.io/badge/version-0.3.0.200419 alpha-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/version-0.4.0.200426 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">
</p>
@ -15,30 +15,31 @@ B 站直播实用脚本
|plugin |version |description |
|--------------------|--------------------|--------------------|
|Login |20.04.19 |账号登录 |
|Schedule |20.04.19 |休眠控制 |
|MasterSite |20.04.19 |主站助手 |
|Daily |20.04.19 |每日礼包 |
|Heart |20.04.19 |双端心跳 |
|Task |20.04.19 |每日任务 |
|Silver |20.04.19 |银瓜子宝箱 |
|Barrage |20.04.19 |活跃弹幕 |
|Silver2Coin |20.04.19 |银瓜子换硬币 |
|GiftSend |20.04.19 |礼物赠送 |
|Judge |20.04.19 |风纪 |
|GroupSignIn |20.04.19 |友爱社签到 |
|ManGa |20.04.19 |漫画签到分享 |
|GiftHeart |20.04.19 |心跳礼物 |
|MaterialObject |20.04.19 |实物抽奖 |
|AloneTcpClient |20.04.19 |独立监控 |
|ZoneTcpClient |20.04.19 |分区监控 |
|StormRaffle |20.04.19 |节奏风暴 |
|GiftRaffle |20.04.19 |活动礼物 |
|PkRaffle |20.04.19 |大乱斗 |
|GuardRaffle |20.04.19 |舰长总督 |
|AnchorRaffle |20.04.19 |天选时刻 |
|AwardRecord |20.04.19 |获奖通知 |
|Statistics |20.04.19 |数据统计 |
|Login |20.04.26 |账号登录 |
|Schedule |20.04.26 |休眠控制 |
|MasterSite |20.04.26 |主站助手 |
|Daily |20.04.26 |每日礼包 |
|Heart |20.04.26 |双端心跳 |
|Task |20.04.26 |每日任务 |
|Silver |20.04.26 |银瓜子宝箱 |
|Barrage |20.04.26 |活跃弹幕 |
|Silver2Coin |20.04.26 |银瓜子换硬币 |
|GiftSend |20.04.26 |礼物赠送 |
|Judge |20.04.26 |风纪 |
|GroupSignIn |20.04.26 |友爱社签到 |
|ManGa |20.04.26 |漫画签到分享 |
|Match |20.04.26 |赛事签到分享 |
|GiftHeart |20.04.26 |心跳礼物 |
|MaterialObject |20.04.26 |实物抽奖 |
|AloneTcpClient |20.04.26 |独立监控 |
|ZoneTcpClient |20.04.26 |分区监控 |
|StormRaffle |20.04.26 |节奏风暴 |
|GiftRaffle |20.04.26 |活动礼物 |
|PkRaffle |20.04.26 |大乱斗 |
|GuardRaffle |20.04.26 |舰长总督 |
|AnchorRaffle |20.04.26 |天选时刻 |
|AwardRecord |20.04.26 |获奖通知 |
|Statistics |20.04.26 |数据统计 |
## 打赏赞助

View File

@ -7,11 +7,9 @@ Group: [55308141](https://jq.qq.com/?_wv=1027&k=5AIDaJg) | **仅用于BUG提交
## 公告
> Currently for Personal Edition **0.3.0.200419 alpha**
> Currently for Personal Edition **0.4.0.200426 alpha**
```notice
开源本身是个很美好的,开源、共享服务放出来给公用,很简单很美好。
从开放服务以来,没想到过会被滥用,免费服务不值得被尊重、被珍惜。
---- 免费的东西总是得不到人的珍惜。
---- 只有花大价钱去买到的东西,才会令人信任。
```

285
composer.lock generated
View File

@ -8,16 +8,16 @@
"packages": [
{
"name": "amphp/amp",
"version": "v2.4.1",
"version": "v2.4.3",
"source": {
"type": "git",
"url": "https://github.com/amphp/amp.git",
"reference": "2ac3b550c4997f2ec304faa63c8b2885079a2dc4"
"reference": "23ac95fc6d6973231763f5ed7d1309b39429b974"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/amphp/amp/zipball/2ac3b550c4997f2ec304faa63c8b2885079a2dc4",
"reference": "2ac3b550c4997f2ec304faa63c8b2885079a2dc4",
"url": "https://api.github.com/repos/amphp/amp/zipball/23ac95fc6d6973231763f5ed7d1309b39429b974",
"reference": "23ac95fc6d6973231763f5ed7d1309b39429b974",
"shasum": "",
"mirrors": [
{
@ -33,14 +33,15 @@
"amphp/php-cs-fixer-config": "dev-master",
"amphp/phpunit-util": "^1",
"ext-json": "*",
"phpstan/phpstan": "^0.8.5",
"jetbrains/phpstorm-stubs": "^2019.3",
"phpunit/phpunit": "^6.0.9 | ^7",
"react/promise": "^2"
"react/promise": "^2",
"vimeo/psalm": "^3.11@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "2.x-dev"
}
},
"autoload": {
@ -87,7 +88,7 @@
"non-blocking",
"promise"
],
"time": "2020-02-10T18:10:57+00:00"
"time": "2020-04-19T15:54:21+00:00"
},
{
"name": "bramus/ansi-php",
@ -246,16 +247,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "6.5.2",
"version": "6.5.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e",
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e",
"shasum": "",
"mirrors": [
{
@ -268,7 +269,8 @@
"ext-json": "*",
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1",
"php": ">=5.5"
"php": ">=5.5",
"symfony/polyfill-intl-idn": "^1.11"
},
"require-dev": {
"ext-curl": "*",
@ -276,7 +278,6 @@
"psr/log": "^1.1"
},
"suggest": {
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"type": "library",
@ -315,7 +316,7 @@
"rest",
"web service"
],
"time": "2019-12-23T11:57:10+00:00"
"time": "2020-04-18T10:38:46+00:00"
},
{
"name": "guzzlehttp/promises",
@ -830,17 +831,253 @@
"time": "2020-02-27T09:26:54+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v4.1.3",
"name": "symfony/polyfill-intl-idn",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "88f7acc95150bca002a498899f8b52f318e444c2"
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/88f7acc95150bca002a498899f8b52f318e444c2",
"reference": "88f7acc95150bca002a498899f8b52f318e444c2",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php72": "^1.10"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Intl\\Idn\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Laurent Bassin",
"email": "laurent@bassin.info"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"idn",
"intl",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-09T19:04:49+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-09T19:04:49+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "37b0976c78b94856543260ce09b460a7bc852747"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747",
"reference": "37b0976c78b94856543260ce09b460a7bc852747",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-02-27T09:26:54+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "feb6dad5ae24b1380827aee1629b730080fde500"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/feb6dad5ae24b1380827aee1629b730080fde500",
"reference": "feb6dad5ae24b1380827aee1629b730080fde500",
"shasum": "",
"mirrors": [
{
@ -898,12 +1135,16 @@
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-03-27T23:37:15+00:00"
"time": "2020-04-12T15:20:09+00:00"
}
],
"packages-dev": [],

View File

@ -60,6 +60,9 @@ SLEEP_SECTION=2,3,4,5,6
# 漫画助手
USE_MANGA=false
# 赛事助手
USE_MATCH=false
# 风纪(测试)
USE_JUDGE=false

View File

@ -69,6 +69,7 @@ class App
'MasterSite',
'Daily',
'ManGa',
'Match',
'Heart',
'Task',
'Silver',

View File

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

View File

@ -236,4 +236,34 @@ class Live
return (float)sprintf('%.0f', (floatval($t1) + floatval($t2)) * 1000);
}
/**
* @use 发送弹幕
* @param int $room_id
* @param string $content
* @return array
*/
public static function sendBarrage(int $room_id, string $content): array
{
$user_info = User::parseCookies();
$url = 'https://api.live.bilibili.com/msg/send';
$payload = [
'color' => '16777215',
'fontsize' => 25,
'mode' => 1,
'msg' => $content,
'rnd' => 0,
'bubble' => 0,
'roomid' => $room_id,
'csrf' => $user_info['token'],
'csrf_token' => $user_info['token'],
];
$headers = [
'origin' => 'https://live.bilibili.com',
'referer' => "https://live.bilibili.com/{$room_id}"
];
$raw = Curl::post('pc', $url, $payload, $headers);
return json_decode($raw, true) ?? ['code' => 404, 'msg' => '上层数据为空!'];
}
}

356
src/plugin/Match.php Normal file

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,7 @@ class Schedule
private static $unlock_timers = [];
private static $sleep_section = [];
// 日常类
private static $fillable = ['Login', 'Schedule', 'Daily', 'Judge', 'MasterSite', 'GiftSend', 'Task', 'Silver2Coin', 'GroupSignIn', 'AwardRecord', 'Statistics'];
private static $fillable = ['Login', 'Schedule', 'Daily', 'Judge', 'MasterSite', 'GiftSend', 'Task', 'Silver2Coin', 'ManGa', 'Match', 'GroupSignIn', 'AwardRecord', 'Statistics'];
// 任务类
private static $guarded_first = ['Barrage', 'GiftHeart', 'Silver', 'MaterialObject'];
// 监控类