File tree Expand file tree Collapse file tree 5 files changed +78
-9
lines changed
src/main/java/org/developerden/codosseum Expand file tree Collapse file tree 5 files changed +78
-9
lines changed Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ paths:
431431 - $ref : " #/components/parameters/pathGameId"
432432 post :
433433 tags : [games]
434- operationId : restart
434+ operationId : restartGame
435435 summary : Restart the game with the same or adjusted settings
436436 description : |
437437 Like starting a new game with the same settings as the current one and directly notifying all previous participants via an event.
Original file line number Diff line number Diff line change @@ -92,6 +92,14 @@ public HttpResponse<String> getCodeTemplate(
9292 throw new UnsupportedOperationException ();
9393 }
9494
95+ @ Post ("/{id}/restart" )
96+ @ GameAuthorized (GameRole .PLAYER )
97+ public HttpResponse <GameCreateResponse > restartGame (
98+ Principal principal , @ PathVariable ("id" ) Game game
99+ ) {
100+ throw new UnsupportedOperationException ();
101+ }
102+
95103 @ ExecuteOn (TaskExecutors .IO )
96104 @ Get ("/{id}/events" )
97105 @ Produces (MediaType .TEXT_EVENT_STREAM )
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2023 JohnnyJayJay
3+ * SPDX-License-Identifier: AGPL-3.0-or-later
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under the terms of
6+ * the GNU Affero General Public License as published by the Free Software Foundation, either
7+ * version 3 of the License, or (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+ * See the GNU Affero General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Affero General Public License along with this program.
14+ * If not, see <https://www.gnu.org/licenses/>.
15+ *
16+ */
17+
18+ package org .developerden .codosseum .controller ;
19+
20+ import io .micronaut .http .annotation .Controller ;
21+ import io .micronaut .http .annotation .Get ;
22+ import java .util .List ;
23+
24+ @ Controller
25+ public class InfoController {
26+
27+ @ Get ("/languages" )
28+ public List <String > getSupportedLanguages () {
29+ throw new UnsupportedOperationException ();
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2023 JohnnyJayJay
3+ * SPDX-License-Identifier: AGPL-3.0-or-later
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under the terms of
6+ * the GNU Affero General Public License as published by the Free Software Foundation, either
7+ * version 3 of the License, or (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+ * See the GNU Affero General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Affero General Public License along with this program.
14+ * If not, see <https://www.gnu.org/licenses/>.
15+ *
16+ */
17+
18+ package org .developerden .codosseum .dto ;
19+
20+ import io .micronaut .core .annotation .Introspected ;
21+ import jakarta .annotation .Nonnull ;
22+ import jakarta .validation .constraints .NotNull ;
23+
24+ @ Introspected
25+ public record GameCreateRequest (
26+ @ Nonnull
27+ @ NotNull
28+ GameSettings settings ,
29+
30+ @ Nonnull
31+ @ NotNull
32+ Player player
33+ ){
34+ }
Original file line number Diff line number Diff line change 2727@ RecordBuilder
2828public record GameInfo (
2929 @ Nonnull
30- String id ,
30+ GameSettings settings ,
3131
3232 @ Nonnull
33- List < String > allowedLanguages ,
33+ String id ,
3434
3535 @ Nonnull
3636 GameMode gameMode ,
3737
38- int maxPlayers ,
39-
40- int timeLimit ,
41-
42- int maxWarmupTime ,
43-
4438 @ Nonnull
4539 Players players ,
4640
@@ -49,6 +43,8 @@ public record GameInfo(
4943
5044 int timeLeft ,
5145
46+ long nextStateAt ,
47+
5248 @ Nullable
5349 Integer round ,
5450
You can’t perform that action at this time.
0 commit comments