Refactor: Fix Spelling of userRequestingRollback (#9307)

This commit is contained in:
DeepCrimson 2022-07-22 20:06:22 -07:00 committed by GitHub
parent f760649f4d
commit de9fcfc7ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ public class GameController implements GameCallback {
private boolean useTimeout = true; private boolean useTimeout = true;
private final GameOptions gameOptions; private final GameOptions gameOptions;
private UUID userReqestingRollback; private UUID userRequestingRollback;
private int turnsToRollback; private int turnsToRollback;
private int requestsOpen; private int requestsOpen;
@ -91,7 +91,7 @@ public class GameController implements GameCallback {
gameSessionId = UUID.randomUUID(); gameSessionId = UUID.randomUUID();
this.userPlayerMap = userPlayerMap; this.userPlayerMap = userPlayerMap;
chatId = managerFactory.chatManager().createChatSession("Game " + game.getId()); chatId = managerFactory.chatManager().createChatSession("Game " + game.getId());
this.userReqestingRollback = null; this.userRequestingRollback = null;
this.game = game; this.game = game;
this.game.setSaveGame(managerFactory.configSettings().isSaveGameActivated()); this.game.setSaveGame(managerFactory.configSettings().isSaveGameActivated());
this.tableId = tableId; this.tableId = tableId;
@ -508,7 +508,7 @@ public class GameController implements GameCallback {
turnsToRollback = -1; turnsToRollback = -1;
requestsOpen = -1; requestsOpen = -1;
} else { } else {
userReqestingRollback = userId; userRequestingRollback = userId;
} }
} else { } else {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
@ -528,12 +528,12 @@ public class GameController implements GameCallback {
} }
break; break;
case ADD_PERMISSION_TO_ROLLBACK_TURN: case ADD_PERMISSION_TO_ROLLBACK_TURN:
if (userReqestingRollback != null && requestsOpen > 0 && !userId.equals(userReqestingRollback)) { if (userRequestingRollback != null && requestsOpen > 0 && !userId.equals(userRequestingRollback)) {
requestsOpen--; requestsOpen--;
if (requestsOpen == 0) { if (requestsOpen == 0) {
game.rollbackTurns(turnsToRollback); game.rollbackTurns(turnsToRollback);
turnsToRollback = -1; turnsToRollback = -1;
userReqestingRollback = null; userRequestingRollback = null;
requestsOpen = -1; requestsOpen = -1;
} }
} }
@ -544,9 +544,9 @@ public class GameController implements GameCallback {
if (playerId != null) { if (playerId != null) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
if (userReqestingRollback != null && requestsOpen > 0 && !userId.equals(userReqestingRollback)) { if (userRequestingRollback != null && requestsOpen > 0 && !userId.equals(userRequestingRollback)) {
turnsToRollback = -1; turnsToRollback = -1;
userReqestingRollback = null; userRequestingRollback = null;
requestsOpen = -1; requestsOpen = -1;
game.informPlayers("Rollback request denied by " + player.getLogName()); game.informPlayers("Rollback request denied by " + player.getLogName());
} }