Update PlayerService to adjust PLAYER_STATE during ROUND_STATE.ENDED phase
This commit is contained in:
parent
3906bd747b
commit
40f52a4a45
|
|
@ -131,7 +131,12 @@ public class PlayerService implements RoundListener {
|
||||||
if (optionalPlayerState.isPresent()) {
|
if (optionalPlayerState.isPresent()) {
|
||||||
PLAYER_STATE playerState = optionalPlayerState.get();
|
PLAYER_STATE playerState = optionalPlayerState.get();
|
||||||
return Optional.of(switch (playerState) {
|
return Optional.of(switch (playerState) {
|
||||||
case DISCONNECTED, SPECTATING -> PLAYER_STATE.SPECTATING;
|
case DISCONNECTED, SPECTATING -> {
|
||||||
|
if (roundState.equals(ROUND_STATE.ENDED)) {
|
||||||
|
yield PLAYER_STATE.REGISTERED;
|
||||||
|
}
|
||||||
|
yield PLAYER_STATE.SPECTATING;
|
||||||
|
}
|
||||||
case REGISTERED -> PLAYER_STATE.REGISTERED;
|
case REGISTERED -> PLAYER_STATE.REGISTERED;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user