Skip to content

Commit

Permalink
Merge pull request ppy#10884 from nanaya/score-submit-disable
Browse files Browse the repository at this point in the history
Add option to disable score submission
  • Loading branch information
peppy authored Jan 29, 2024
2 parents c696378 + 2211d4f commit 6c2f706
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ CLIENT_CHECK_VERSION=false
# SCORES_EXPERIMENTAL_RANK_AS_DEFAULT=false
# SCORES_EXPERIMENTAL_RANK_AS_EXTRA=false
# SCORES_PROCESSING_QUEUE=osu-queue:score-statistics
# SCORES_SUBMISSION_ENABLED=1
# SCORES_RANK_CACHE_LOCAL_SERVER=0
# SCORES_RANK_CACHE_MIN_USERS=35000
# SCORES_RANK_CACHE_SERVER_URL=
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Controllers/ScoreTokensController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function __construct()

public function store($beatmapId)
{
if (!$GLOBALS['cfg']['osu']['scores']['submission_enabled']) {
abort(422, 'score submission is disabled');
}

$beatmap = Beatmap::increasesStatistics()->findOrFail($beatmapId);
$user = auth()->user();
$rawParams = request()->all();
Expand Down
2 changes: 2 additions & 0 deletions config/osu.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
'experimental_rank_as_default' => get_bool(env('SCORES_EXPERIMENTAL_RANK_AS_DEFAULT')) ?? false,
'experimental_rank_as_extra' => get_bool(env('SCORES_EXPERIMENTAL_RANK_AS_EXTRA')) ?? false,
'processing_queue' => presence(env('SCORES_PROCESSING_QUEUE')) ?? 'osu-queue:score-statistics',
'submission_enabled' => get_bool(env('SCORES_SUBMISSION_ENABLED')) ?? true,

'rank_cache' => [
'local_server' => get_bool(env('SCORES_RANK_CACHE_LOCAL_SERVER')) ?? false,
'min_users' => get_int(env('SCORES_RANK_CACHE_MIN_USERS')) ?? 35000,
Expand Down

0 comments on commit 6c2f706

Please sign in to comment.