Fix ticket booth commands clashing with leave commands
This commit is contained in:
parent
8fa0caba8d
commit
3a2cfa7c98
|
@ -199,19 +199,20 @@ public class TicketBooth {
|
|||
final PlayerId playerId = userStore.playerId(player);
|
||||
final Game game = currentGame(playerId);
|
||||
if(game == null) {
|
||||
audience.sendMessage(gameFormatter.notPlaying());
|
||||
//audience.sendMessage(gameFormatter.notPlaying());
|
||||
return;
|
||||
}
|
||||
|
||||
syncExecutor.callback(
|
||||
sendPlayRequest(playerId, null),
|
||||
CommandFutureCallback.onSuccess(player, reply -> {
|
||||
audience.sendMessage(gameFormatter.left(game));
|
||||
if(returnToLobby) {
|
||||
serverChanger.sendPlayerToLobby(player, true);
|
||||
}
|
||||
})
|
||||
);
|
||||
if(game != null) {
|
||||
syncExecutor.callback(
|
||||
sendPlayRequest(playerId, null),
|
||||
CommandFutureCallback.onSuccess(player, reply -> {
|
||||
audience.sendMessage(gameFormatter.left(game));
|
||||
if(returnToLobby) {
|
||||
serverChanger.sendPlayerToLobby(player, true);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void playLocalGame(Player player) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class TicketCommands implements Commands {
|
|||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "leave", "quit" },
|
||||
aliases = { "quit" },
|
||||
desc = "Leave the game you are currently playing, or waiting to play",
|
||||
min = 0,
|
||||
max = 0
|
||||
|
|
|
@ -133,7 +133,7 @@ public class JoinCommands implements Commands {
|
|||
public static final String OBSERVE_COMMAND = "observe";
|
||||
|
||||
@Command(
|
||||
aliases = { OBSERVE_COMMAND, "obs", "spectate" },
|
||||
aliases = { OBSERVE_COMMAND, "obs", "spectate", "leave" },
|
||||
desc = "Observe the current match",
|
||||
min = 0,
|
||||
max = 0
|
||||
|
|
Loading…
Reference in New Issue