diff --git a/src/org/emulinker/kaillera/controller/v086/action/GameChatAction.java b/src/org/emulinker/kaillera/controller/v086/action/GameChatAction.java index a055299..7ac29bd 100644 --- a/src/org/emulinker/kaillera/controller/v086/action/GameChatAction.java +++ b/src/org/emulinker/kaillera/controller/v086/action/GameChatAction.java @@ -202,6 +202,11 @@ public class GameChatAction implements V086Action, V086GameEventHandler user1.getGame().announce("User not found!", user1); return; } + + if(user.getGame() != user1.getGame()) { + user1.getGame().announce("User not in this game!", user1); + return; + } if(user == clientHandler.getUser()){ user1.getGame().announce("You can't private message yourself!", user1); @@ -245,11 +250,11 @@ public class GameChatAction implements V086Action, V086GameEventHandler //user1.getServer().announce("TO: <" + user.getName() + ">(" + user.getID() + ") <" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, false, user1); //user.getServer().announce("<" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, false, user); - if(user1.getGame() != null && user1.getGame() == user.getGame()){ + if(user1.getGame() != null){ user1.getGame().announce("TO: <" + user.getName() + ">(" + user.getID() + ") <" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, user1); } - if(user.getGame() != null && user.getGame() == user1.getGame()){ + if(user.getGame() != null){ user.getGame().announce("<" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, user); } return; @@ -272,6 +277,11 @@ public class GameChatAction implements V086Action, V086GameEventHandler user1.getGame().announce("User not found!", user1); return; } + + if(user.getGame() != user1.getGame()) { + user1.getGame().announce("User not in this game!", user1); + return; + } if(user == clientHandler.getUser()){ user1.getGame().announce("You can't private message yourself!", user1); @@ -313,11 +323,11 @@ public class GameChatAction implements V086Action, V086GameEventHandler //user1.getServer().announce("TO: <" + user.getName() + ">(" + user.getID() + ") <" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, false, user1); //user.getServer().announce("<" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, false, user); - if(user1.getGame() != null && user1.getGame() == user.getGame()){ + if(user1.getGame() != null){ user1.getGame().announce("TO: <" + user.getName() + ">(" + user.getID() + ") <" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, user1); } - if(user.getGame() != null && user.getGame() == user1.getGame()){ + if(user.getGame() != null){ user.getGame().announce("<" + clientHandler.getUser().getName() + "> (" + clientHandler.getUser().getID() + "): " + m, user); } return; diff --git a/src/org/emulinker/kaillera/controller/v086/action/GameOwnerCommandAction.java b/src/org/emulinker/kaillera/controller/v086/action/GameOwnerCommandAction.java index edfd079..a62f6ac 100644 --- a/src/org/emulinker/kaillera/controller/v086/action/GameOwnerCommandAction.java +++ b/src/org/emulinker/kaillera/controller/v086/action/GameOwnerCommandAction.java @@ -148,6 +148,7 @@ public class GameOwnerCommandAction implements V086Action else { log.warn("GameOwner Command Denied: Not game owner: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + game.announce("GameOwner Command Error: You are not an owner!", user); return; } } diff --git a/src/org/emulinker/kaillera/model/impl/KailleraUserImpl.java b/src/org/emulinker/kaillera/model/impl/KailleraUserImpl.java index b77fc6d..893b3f7 100644 --- a/src/org/emulinker/kaillera/model/impl/KailleraUserImpl.java +++ b/src/org/emulinker/kaillera/model/impl/KailleraUserImpl.java @@ -535,6 +535,12 @@ public final class KailleraUserImpl implements KailleraUser, Executable public synchronized KailleraGame createGame(String romName) throws CreateGameException, FloodException { updateLastActivity(); + + if (server.getUser(getID()) == null) + { + log.error(this + " create game failed: User don't exists!"); + return null; + } if (getStatus() == KailleraUser.STATUS_PLAYING) { @@ -664,8 +670,9 @@ public final class KailleraUserImpl implements KailleraUser, Executable if (status == KailleraUser.STATUS_PLAYING) { - game.drop(this, playerNumber); + //first set STATUS_IDLE and then call game.drop, otherwise if someone quit game whitout drop - game status will not change to STATUS_WAITING setStatus(KailleraUser.STATUS_IDLE); + game.drop(this, playerNumber); } game.quit(this, playerNumber); diff --git a/src/org/emulinker/kaillera/release/KailleraServerReleaseInfo.java b/src/org/emulinker/kaillera/release/KailleraServerReleaseInfo.java index b554000..7aad5e8 100644 --- a/src/org/emulinker/kaillera/release/KailleraServerReleaseInfo.java +++ b/src/org/emulinker/kaillera/release/KailleraServerReleaseInfo.java @@ -13,9 +13,9 @@ public final class KailleraServerReleaseInfo implements ReleaseInfo private final int majorVersion = 0; private final int minorVersion = 92; - private final int buildNumber = 4; + private final int buildNumber = 7; - private final String releaseDate = "05-06-2021"; + private final String releaseDate = "08-21-2021"; private final String licenseInfo = "Usage of this sofware is subject to the terms found in the included license"; private final String website = "https://www.EmuLinker.org";