Skip to content

Commit 7d9cd0a

Browse files
authored
Merge pull request #913 from project-primera/develop
Release 0.20.8
2 parents df947fa + d9f1659 commit 7d9cd0a

File tree

3 files changed

+59
-19
lines changed

3 files changed

+59
-19
lines changed

OngekiScoreLog/app/Http/Controllers/ViewMusicStatisticsController.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ function getIndex(int $music, string $difficulty){
5959
$technicalGrades = ["AB+", "SSS+", "SSS", "SS", "S", "AAA", "AA", "A", "B"];
6060

6161
$rateKeys = [];
62-
for ($i = 0; $i <= 17; ++$i) {
62+
for ($i = 0; $i <= 25; ++$i) {
6363
$rateKeys[] = $i . ".00";
64-
$rateKeys[] = $i . ".25";
6564
$rateKeys[] = $i . ".50";
66-
$rateKeys[] = $i . ".75";
6765
}
6866

6967
foreach ($rateKeys as $value) {
@@ -77,12 +75,10 @@ function getIndex(int $music, string $difficulty){
7775

7876
foreach ($scoreData as $key => $value) {
7977
$rateKey = $users[$value->user_id]->rating;
80-
$rateKey = floor(floor($rateKey * 40) / 10);
78+
$rateKey = floor(floor($rateKey * 20) / 10);
8179
switch (true) {
82-
case ($rateKey % 4 == 0): $rateKey = floor($rateKey / 4) . ".00"; break;
83-
case ($rateKey % 4 == 1): $rateKey = floor($rateKey / 4) . ".25"; break;
84-
case ($rateKey % 4 == 2): $rateKey = floor($rateKey / 4) . ".50"; break;
85-
case ($rateKey % 4 == 3): $rateKey = floor($rateKey / 4) . ".75"; break;
80+
case ($rateKey % 2 == 0): $rateKey = floor($rateKey / 2) . ".00"; break;
81+
case ($rateKey % 2 == 1): $rateKey = floor($rateKey / 2) . ".50"; break;
8682
}
8783

8884
$battleKey = $users[$value->user_id]->battle_point;

OngekiScoreLog/app/Services/Slack.php

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,74 @@
33

44
class Slack {
55
public function Default(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
6-
(new \App\NotifySlack(""))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Default"));
6+
try {
7+
(new \App\NotifySlack(""))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Default"));
8+
} catch (\Throwable $th) {
9+
// なにもしない
10+
}
711
}
12+
813
public function Debug(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
9-
(new \App\NotifySlack("debug"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Debug"));
14+
try {
15+
(new \App\NotifySlack("debug"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Debug"));
16+
} catch (\Throwable $th) {
17+
// なにもしない
18+
}
1019
}
20+
1121
public function Info(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
12-
(new \App\NotifySlack("info"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name , "Info"));
22+
try {
23+
(new \App\NotifySlack("info"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name , "Info"));
24+
} catch (\Throwable $th) {
25+
// なにもしない
26+
}
1327
}
28+
1429
public function Notice(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
15-
(new \App\NotifySlack("notice"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Notice"));
30+
try {
31+
(new \App\NotifySlack("notice"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Notice"));
32+
} catch (\Throwable $th) {
33+
// なにもしない
34+
}
1635
}
36+
1737
public function Warning(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
18-
(new \App\NotifySlack("warning"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Warning"));
38+
try {
39+
(new \App\NotifySlack("warning"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Warning"));
40+
} catch (\Throwable $th) {
41+
// なにもしない
42+
}
1943
}
44+
2045
public function Error(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
21-
(new \App\NotifySlack("error"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Error"));
46+
try {
47+
(new \App\NotifySlack("error"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Error"));
48+
} catch (\Throwable $th) {
49+
// なにもしない
50+
}
2251
}
52+
2353
public function Critical(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
24-
(new \App\NotifySlack("critical"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Critical"));
54+
try {
55+
(new \App\NotifySlack("critical"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Critical"));
56+
} catch (\Throwable $th) {
57+
// なにもしない
58+
}
2559
}
60+
2661
public function Alert(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
27-
(new \App\NotifySlack("alert"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Alert"));
62+
try {
63+
(new \App\NotifySlack("alert"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Alert"));
64+
} catch (\Throwable $th) {
65+
// なにもしない
66+
}
2867
}
68+
2969
public function Emergency(string $content, $fileContent = false, $fields = [], string $type = "", string $name = "LaravelLogger"){
30-
(new \App\NotifySlack("emergency"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Emergency"));
70+
try {
71+
(new \App\NotifySlack("emergency"))->notify(new \App\Notifications\SlackNotification($content, $fileContent, $fields, $type, $name, "Emergency"));
72+
} catch (\Throwable $th) {
73+
// なにもしない
74+
}
3175
}
32-
}
76+
}

OngekiScoreLog/routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Route::get('/user/{id}/overdamage/{difficulty?}', 'ViewUserController@getOverDamegePage')->where(['id' => '\d+', 'difficulty' => '\w+']);
2525
Route::get('/user/{id}/{mode?}', 'ViewUserController@getUserPage')->where(['id' => '\d+']);
2626

27-
Route::middleware('throttle:3,1')->group(function () {
27+
Route::middleware('throttle:1,1')->group(function () {
2828
Route::get('/music/{music}/{difficulty}', 'ViewMusicStatisticsController@getIndex')->where(['music' => '\d+', 'difficulty' => '\w+']);
2929
Route::get('/music/{music}', 'ViewMusicStatisticsController@getRedirect')->where(['music' => '\d+']);
3030
});

0 commit comments

Comments
 (0)