Skip to content

Commit

Permalink
Merge pull request #11712 from nanaya/room-name-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy authored Dec 4, 2024
2 parents d277c9a + ba26bb4 commit 79a1eb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Models/Multiplayer/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ public function startGame(User $host, array $rawParams, array $extraParams = [])
throw new InvariantException('room must have at least one playlist item');
}

if (mb_strlen($this->name) > 100) {
throw new InvariantException(osu_trans('multiplayer.room.errors.name_too_long'));
}

PlaylistItem::assertBeatmapsExist($playlistItems);

$this->getConnection()->transaction(function () use ($host, $playlistItems) {
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/multiplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

'errors' => [
'duration_too_long' => 'Duration is too long.',
'name_too_long' => 'Room name is too long.',
],

'status' => [
Expand Down

0 comments on commit 79a1eb1

Please sign in to comment.