diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/LoginServerThread.java index 68b9b47c2b..ea976c4545 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -284,7 +284,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ebcabf6663..b482a5123e 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -906,11 +906,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4261,22 +4257,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7397,13 +7377,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/LoginServerThread.java index 68b9b47c2b..ea976c4545 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -284,7 +284,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 5ae41f761a..dd3c3d24a0 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -912,11 +912,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4267,22 +4263,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7404,13 +7384,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/LoginServerThread.java index 7842e73fbf..e26cf1111a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -286,7 +286,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 02aa75ca94..f8f544f70d 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -914,11 +914,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4269,22 +4265,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7406,13 +7386,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/LoginServerThread.java index 7842e73fbf..e26cf1111a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -286,7 +286,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ac3b4823e7..8cd0ece3e1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -925,11 +925,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4260,22 +4256,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7403,13 +7383,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index be5bfd8b89..b4f6de1d02 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7565,8 +7565,8 @@ public final class L2PcInstance extends L2Playable /** * Verifies if the player is in offline mode.
* The offline mode may happen for different reasons:
- * Abnormally: Player gets abrouptaly disconnected from server.
- * Normally: The player gets into offline shop mode, only avaiable by enabling the offline shop mod. + * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. * @return {@code true} if the player is in offline mode, {@code false} otherwise */ public boolean isInOfflineMode() diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/LoginServerThread.java index 7842e73fbf..e26cf1111a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -286,7 +286,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index bd8290b416..211f628b63 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -908,11 +908,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4237,22 +4233,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7369,13 +7349,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/LoginServerThread.java index 7842e73fbf..e26cf1111a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -286,7 +286,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index d2e0803a82..5a3ca8d5d6 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -908,11 +908,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4237,22 +4233,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7369,13 +7349,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/LoginServerThread.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/LoginServerThread.java index 7842e73fbf..e26cf1111a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/LoginServerThread.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/LoginServerThread.java @@ -286,7 +286,7 @@ public class LoginServerThread extends Thread st.addAttribute(ServerStatus.SERVER_AGE, ServerStatus.SERVER_AGE_ALL); } sendPacket(st); - final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInStoreMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); + final List playerList = L2World.getInstance().getPlayers().stream().filter(player -> !player.isInOfflineMode()).map(L2PcInstance::getAccountName).collect(Collectors.toList()); if (!playerList.isEmpty()) { sendPacket(new PlayerInGame(playerList)); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ea7ce83538..c714dca137 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -908,11 +908,7 @@ public final class L2PcInstance extends L2Playable public String getAccountName() { - if (getClient() == null) - { - return getAccountNamePlayer(); - } - return getClient().getAccountName(); + return getClient() == null ? getAccountNamePlayer() : getClient().getAccountName(); } public String getAccountNamePlayer() @@ -4237,22 +4233,6 @@ public final class L2PcInstance extends L2Playable return getClan().getAllyCrestId(); } - //@formatter:off - /* - public void queryGameGuard() - { - if (getClient() != null) - { - getClient().setGameGuardOk(false); - sendPacket(GameGuardQuery.STATIC_PACKET); - } - if (Config.GAMEGUARD_ENFORCE) - { - ThreadPoolManager.scheduleGeneral(new GameGuardCheckTask(this), 30 * 1000); - } - }*/ - //@formatter:on - /** * Send a Server->Client packet StatusUpdate to the L2PcInstance. */ @@ -7371,13 +7351,25 @@ public final class L2PcInstance extends L2Playable public int isOnlineInt() { - if (_isOnline && (getClient() != null)) + if (_isOnline && (_client != null)) { - return getClient().isDetached() ? 2 : 1; + return _client.isDetached() ? 2 : 1; } return 0; } + /** + * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod. + * @return {@code true} if the player is in offline mode, {@code false} otherwise + */ + public boolean isInOfflineMode() + { + return (_client == null) || _client.isDetached(); + } + @Override public Skill addSkill(Skill newSkill) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/L2GameClient.java index 0f0ec33f85..745d5a1b1a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/L2GameClient.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/L2GameClient.java @@ -121,7 +121,7 @@ public final class L2GameClient extends ChannelInboundHandler LoginServerThread.getInstance().sendLogout(getAccountName()); - if ((_activeChar == null) || !_activeChar.isInStoreMode()) + if ((_activeChar == null) || !_activeChar.isInOfflineMode()) { IdFactory.getInstance().releaseId(getObjectId()); Disconnection.of(this).onDisconnection();