diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_01.0_Ertheia/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java index ee5568aae0..5c9bc44d3d 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java @@ -1097,6 +1097,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3286,6 +3287,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 063dee5d6f..73f1dee05f 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -206,10 +206,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_02.5_Underground/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_02.5_Underground/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java index 0729c860da..aaf7ba78c0 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java @@ -1108,6 +1108,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3312,6 +3313,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index bae53f4051..a44522278b 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_03.0_Helios/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_03.0_Helios/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_03.0_Helios/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java index 16ffb8e9a6..f8e64ccb81 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java @@ -1121,6 +1121,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3334,6 +3335,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index bae53f4051..a44522278b 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java index 34fec51483..34c8ffc5ee 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -1108,6 +1108,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3308,6 +3309,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 712cd88b49..83054a4b99 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_05.0_Salvation/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_05.0_Salvation/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_05.0_Salvation/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java index 027601cd73..ad9e4ac32f 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java @@ -1107,6 +1107,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3317,6 +3318,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index eb7bb653f0..b2341e0174 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -270,10 +270,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java index c7ac4db033..4a3b99e1b8 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java @@ -1114,6 +1114,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3329,6 +3330,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2022810da2..9398911202 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -292,10 +292,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_06.0_Fafurion/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_06.0_Fafurion/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java index 9787c8721a..5940174012 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java @@ -1136,6 +1136,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3372,6 +3373,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2022810da2..9398911202 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -292,10 +292,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java index 7be8c53839..596762f4b7 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -1144,6 +1144,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3388,6 +3389,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2022810da2..9398911202 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -292,10 +292,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java index 52e5702bae..3388537af2 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java @@ -1136,6 +1136,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3364,6 +3365,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 052bf88e69..e77545a86f 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -271,10 +271,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java index d6ebce5afa..98c86f852a 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java @@ -1147,6 +1147,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3400,6 +3401,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 052bf88e69..e77545a86f 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -271,10 +271,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_10.1_MasterClass/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_10.1_MasterClass/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java index cbed4874cb..2719c602e1 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java @@ -1147,6 +1147,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3400,6 +3401,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index b97d8d412c..ebc3a35074 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -275,10 +275,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java index cbed4874cb..2719c602e1 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java @@ -1147,6 +1147,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3400,6 +3401,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 08f39e9d25..d3b6b7f458 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -276,10 +276,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_CT_0_Interlude/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_CT_0_Interlude/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_CT_0_Interlude/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java index 8945e35522..44db0a991f 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java @@ -1112,6 +1112,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -2757,6 +2758,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index 8918e6aa19..8382f52163 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -95,6 +95,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2c9cc44f83..84df4296a6 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -185,10 +185,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java index 970a2e36e6..a06274abbc 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java @@ -1166,6 +1166,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -2875,6 +2876,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index d4e3f47c3a..a5422c3970 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -96,6 +96,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index e0fca04589..9ae4907217 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -159,10 +159,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java index 45f2611890..a12d04fe6d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java @@ -1166,6 +1166,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -2882,6 +2883,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index 52974f3584..cbbe9570db 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -103,6 +103,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 3837d20056..3b625f64b7 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -169,10 +169,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_1.0/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_1.0/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_1.0/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_1.0/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java index 2b385cd22c..513d9da201 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java @@ -1047,6 +1047,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3187,6 +3188,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 063dee5d6f..73f1dee05f 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -206,10 +206,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java index 27aa3bcd0e..558382f529 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java @@ -1057,6 +1057,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3216,6 +3217,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index bae53f4051..a44522278b 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index 866f7917cf..18cbc2b3e3 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -1056,6 +1056,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3214,6 +3215,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index bae53f4051..a44522278b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java index 51ab85febc..ecdbe8252b 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java @@ -1060,6 +1060,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3220,6 +3221,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 712cd88b49..83054a4b99 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java index 51ab85febc..ecdbe8252b 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java @@ -1060,6 +1060,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3220,6 +3221,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index e37f2164d5..7cf8ffe1dc 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -246,10 +246,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java index 51ab85febc..ecdbe8252b 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java @@ -1060,6 +1060,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3220,6 +3221,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 847c203778..fc0089362f 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -269,10 +269,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java index 217e6e5b6a..e88a36a9a6 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -1065,6 +1065,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3229,6 +3230,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 847c203778..fc0089362f 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -269,10 +269,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index 0ab627c47d..f12d04e84a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -1071,6 +1071,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3274,6 +3275,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 847c203778..fc0089362f 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -269,10 +269,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 8154688052..37da188b02 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -1072,6 +1072,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3234,6 +3235,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 18c4ec91a3..d3252ab78f 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -205,10 +205,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java index 8ae9615ae2..5a251bafd3 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java @@ -1097,6 +1097,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3327,6 +3328,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 052bf88e69..e77545a86f 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -271,10 +271,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java index 3226b52364..6425ca6a01 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java @@ -1105,6 +1105,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3429,6 +3430,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 052bf88e69..e77545a86f 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -271,10 +271,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java index 394a8dbf11..74c9a19491 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java @@ -1112,6 +1112,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3443,6 +3444,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2ddadcbdc2..00c0121e0b 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -273,10 +273,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Custom/OfflineTrade.ini b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Custom/OfflineTrade.ini index 86a32a4fe4..0da95393a1 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Custom/OfflineTrade.ini +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Custom/OfflineTrade.ini @@ -3,44 +3,41 @@ # --------------------------------------------------------------------------- # Option to enable or disable offline trade feature. -# Enable -> true, Disable -> false OfflineTradeEnable = True # Option to enable or disable offline craft feature. -# Enable -> true, Disable -> false OfflineCraftEnable = True # If set to True, off-line shops will be possible only peace zones. -# Default: False OfflineModeInPeaceZone = True # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. -# Default: False OfflineModeNoDamage = True -# If set to True, name color will be changed then entering offline mode +# If set to True, name color will be changed then entering offline mode. OfflineSetNameColor = True -# Color of the name in offline mode (if OfflineSetNameColor = True) +# Color of the name in offline mode (if OfflineSetNameColor = True). OfflineNameColor = 808080 -# Allow fame for characters in offline mode -# Enable -> true, Disable -> false +# Allow fame for characters in offline mode. OfflineFame = True -#Restore offline traders/crafters after restart/shutdown. Default: false. +# Restore offline traders after restart/shutdown. RestoreOffliners = True -#Do not restore offline characters, after OfflineMaxDays days spent from first restore. -#Require server restart to disconnect expired shops. -#0 = disabled (always restore). -#Default: 10 -OfflineMaxDays = 10 +# Do not restore offline characters, after OfflineMaxDays days spent from first restore. +# Require server restart to disconnect expired shops. +# 0 = disabled (always restore). +OfflineMaxDays = 0 -#Disconnect shop after finished selling, buying. -#Default: True +# Disconnect shop after finished selling, buying. OfflineDisconnectFinished = True -#Store offline trader transactions in realtime. -#Uses more datatabase resources, but helps if server shuts down unexpectedly. +# Disconnect shop when character from same account logins to the game. +OfflineDisconnectSameAccount = False + +# Store offline trader transactions in realtime. +# Uses more datatabase resources, but helps if server shuts down unexpectedly. StoreOfflineTradeInRealtime = True + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java index a160f98b90..9cd892bcb8 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java @@ -1112,6 +1112,7 @@ public class Config public static boolean RESTORE_OFFLINERS; public static int OFFLINE_MAX_DAYS; public static boolean OFFLINE_DISCONNECT_FINISHED; + public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean OFFLINE_FAME; @@ -3443,6 +3444,7 @@ public class Config RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); + OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); // Load PasswordChange config file (if exists) diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java index b32aa96188..85c4d6f633 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/CharacterSelect.java @@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket return; } + // Disconnect offline trader. + final Player player = World.getInstance().getPlayer(info.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } + // Banned? if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java index 2bf3eed8f5..8d4d232e11 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java @@ -274,10 +274,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket if (charInfopackage != null) { characterList.add(charInfopackage); - final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); - if (player != null) + + // Disconnect offline trader. + if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT) { - Disconnection.of(player).storeMe().deleteMe(); + final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); + if (player != null) + { + Disconnection.of(player).storeMe().deleteMe(); + } } } }