File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
plugin/src/server/sc/plugin2021
sdk/src/server-api/sc/api/plugins/exceptions
server/src/sc/server/gaming Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class Game(override val currentState: GameState = GameState()): AbstractGame<Pla
23
23
private val availableTeams = mutableListOf (Team .ONE , Team .TWO )
24
24
override fun onPlayerJoined (): Player {
25
25
if (availableTeams.isEmpty())
26
- throw TooManyPlayersException ()
26
+ throw TooManyPlayersException (this )
27
27
val player = currentState.getPlayer(availableTeams.removeAt(0 ))
28
28
29
29
players.add(player)
Original file line number Diff line number Diff line change 1
1
package sc.api.plugins.exceptions
2
2
3
- class TooManyPlayersException : IllegalStateException (" Attempted to join an already full game" )
3
+ class TooManyPlayersException (game : Any? = null ):
4
+ IllegalStateException (" Attempted to join an already full game${game?.let { " : $it " }} " )
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ public List<PlayerSlot> getSlots() {
286
286
287
287
private PlayerSlot openSlot () {
288
288
if (playerSlots .size () >= getMaximumPlayerCount ())
289
- throw new TooManyPlayersException ();
289
+ throw new TooManyPlayersException (this );
290
290
PlayerSlot slot = new PlayerSlot (this );
291
291
Player player = game .onPlayerJoined ();
292
292
slot .setPlayer (player );
You can’t perform that action at this time.
0 commit comments