software-challenge / backend

Server, Client und Spiel-Plugins der Software-Challenge Germany
https://www.software-challenge.de
11 stars 10 forks source link

GameLogicException: Trying to access the currently active color with invalid index #308

Closed SKoschnicke closed 3 years ago

SKoschnicke commented 3 years ago

Tritt zum Ende eines Spiels mit zwei SimpleClients auf. Server ist auf dem Stand 93c3ba37.

09:01:25 INFO  sc.player2021.logic.Logic - Zug: 54 Spieler: Two
09:01:25 INFO  sc.player2021.logic.Logic - Spielerwechsel: Two
09:01:25 INFO  sc.player2021.logic.Logic - Es wurde ein Zug angefordert.
09:01:25 ERROR sc.plugin2021.GameState - :-- Exception on accessing currentColor --:
orderedColors:     []
currentColorIndex: 0
09:01:25 ERROR sc.networking.clients.XStreamClient - Unknown Communication Error
sc.api.plugins.exceptions.GameLogicException: Trying to access the currently active color with invalid index
    at sc.plugin2021.GameState.getCurrentColor(GameState.kt:90)
    at sc.plugin2021.GameState.getCurrentTeam(GameState.kt:67)
    at sc.plugin2021.GameState.getCurrentPlayer(GameState.kt:71)
    at sc.player2021.logic.Logic.onUpdate(Logic.java:73)
    at sc.plugin2021.AbstractClient.onNewState(AbstractClient.kt:98)
    at sc.networking.clients.LobbyClient.onNewState(LobbyClient.java:207)
    at sc.networking.clients.LobbyClient.onObject(LobbyClient.java:77)
    at sc.networking.clients.XStreamClient.receiveThread(XStreamClient.java:110)
    at sc.networking.clients.XStreamClient$1.run(XStreamClient.java:74)
    at java.lang.Thread.run(Thread.java:748)
09:01:25 WARN  sc.networking.clients.XStreamClient - Client sc.networking.clients.LobbyClient@1c3b9bf5 disconnected (Cause: UNKNOWN, Exception: {})
sc.api.plugins.exceptions.GameLogicException: Trying to access the currently active color with invalid index
    at sc.plugin2021.GameState.getCurrentColor(GameState.kt:90)
    at sc.plugin2021.GameState.getCurrentTeam(GameState.kt:67)
    at sc.plugin2021.GameState.getCurrentPlayer(GameState.kt:71)
    at sc.player2021.logic.Logic.onUpdate(Logic.java:73)
    at sc.plugin2021.AbstractClient.onNewState(AbstractClient.kt:98)
    at sc.networking.clients.LobbyClient.onNewState(LobbyClient.java:207)
    at sc.networking.clients.LobbyClient.onObject(LobbyClient.java:77)
    at sc.networking.clients.XStreamClient.receiveThread(XStreamClient.java:110)
    at sc.networking.clients.XStreamClient$1.run(XStreamClient.java:74)
    at java.lang.Thread.run(Thread.java:748)
09:01:25 INFO  sc.networking.clients.XStreamClient - Stopping XStreamClient ReceiveThread id:10 client:LobbyClient
09:01:25 WARN  sc.networking.clients.XStreamClient - ReceiveThread is stopping itself
xeruf commented 3 years ago

Reproduced it.

xeruf commented 3 years ago

client1.log

xeruf commented 3 years ago

I think I found the issue