Addition of OfflineDisconnectSameAccount configuration.

This commit is contained in:
MobiusDevelopment
2022-08-21 21:01:31 +00:00
parent 029982862e
commit 2a4a17b73f
112 changed files with 896 additions and 588 deletions
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1097,6 +1097,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3286,6 +3287,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -206,6 +206,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -215,6 +219,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1108,6 +1108,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3312,6 +3313,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1121,6 +1121,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3334,6 +3335,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1108,6 +1108,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3308,6 +3309,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1107,6 +1107,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3317,6 +3318,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -270,6 +270,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -279,6 +283,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1114,6 +1114,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3329,6 +3330,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -292,6 +292,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -301,6 +305,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1136,6 +1136,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3372,6 +3373,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -292,6 +292,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -301,6 +305,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1144,6 +1144,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3388,6 +3389,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -292,6 +292,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -301,6 +305,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1136,6 +1136,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3364,6 +3365,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -271,6 +271,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -280,6 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1147,6 +1147,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3400,6 +3401,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -271,6 +271,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -280,6 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1147,6 +1147,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3400,6 +3401,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -275,6 +275,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -284,6 +288,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1147,6 +1147,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3400,6 +3401,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -276,6 +276,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -285,6 +289,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1112,6 +1112,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -2757,6 +2758,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -95,6 +95,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -185,6 +185,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -194,6 +198,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1166,6 +1166,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -2875,6 +2876,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -96,6 +96,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -159,6 +159,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -168,6 +172,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1166,6 +1166,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -2882,6 +2883,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -103,6 +103,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -169,6 +169,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -178,6 +182,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1047,6 +1047,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3187,6 +3188,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -206,6 +206,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -215,6 +219,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1057,6 +1057,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3216,6 +3217,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1056,6 +1056,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3214,6 +3215,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1060,6 +1060,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3220,6 +3221,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1060,6 +1060,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3220,6 +3221,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -246,6 +246,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -255,6 +259,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1060,6 +1060,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3220,6 +3221,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -269,6 +269,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -278,6 +282,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1065,6 +1065,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3229,6 +3230,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -269,6 +269,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -278,6 +282,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1071,6 +1071,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3274,6 +3275,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -269,6 +269,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -278,6 +282,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1072,6 +1072,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3234,6 +3235,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -205,6 +205,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -214,6 +218,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
@@ -3,44 +3,41 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Option to enable or disable offline trade feature. # Option to enable or disable offline trade feature.
# Enable -> true, Disable -> false
OfflineTradeEnable = True OfflineTradeEnable = True
# Option to enable or disable offline craft feature. # Option to enable or disable offline craft feature.
# Enable -> true, Disable -> false
OfflineCraftEnable = True OfflineCraftEnable = True
# If set to True, off-line shops will be possible only peace zones. # If set to True, off-line shops will be possible only peace zones.
# Default: False
OfflineModeInPeaceZone = True OfflineModeInPeaceZone = True
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed. # If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
# Default: False
OfflineModeNoDamage = True 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 OfflineSetNameColor = True
# Color of the name in offline mode (if OfflineSetNameColor = True) # Color of the name in offline mode (if OfflineSetNameColor = True).
OfflineNameColor = 808080 OfflineNameColor = 808080
# Allow fame for characters in offline mode # Allow fame for characters in offline mode.
# Enable -> true, Disable -> false
OfflineFame = True OfflineFame = True
#Restore offline traders/crafters after restart/shutdown. Default: false. # Restore offline traders after restart/shutdown.
RestoreOffliners = True RestoreOffliners = True
# Do not restore offline characters, after OfflineMaxDays days spent from first restore. # Do not restore offline characters, after OfflineMaxDays days spent from first restore.
# Require server restart to disconnect expired shops. # Require server restart to disconnect expired shops.
# 0 = disabled (always restore). # 0 = disabled (always restore).
#Default: 10 OfflineMaxDays = 0
OfflineMaxDays = 10
# Disconnect shop after finished selling, buying. # Disconnect shop after finished selling, buying.
#Default: True
OfflineDisconnectFinished = True OfflineDisconnectFinished = True
# Disconnect shop when character from same account logins to the game.
OfflineDisconnectSameAccount = False
# Store offline trader transactions in realtime. # Store offline trader transactions in realtime.
# Uses more datatabase resources, but helps if server shuts down unexpectedly. # Uses more datatabase resources, but helps if server shuts down unexpectedly.
StoreOfflineTradeInRealtime = True StoreOfflineTradeInRealtime = True
@@ -1097,6 +1097,7 @@ public class Config
public static boolean RESTORE_OFFLINERS; public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3327,6 +3328,7 @@ public class Config
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false); RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10); OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true); OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
return; return;
} }
// Disconnect offline trader.
final Player player = World.getInstance().getPlayer(info.getObjectId());
if (player != null)
{
Disconnection.of(player).storeMe().deleteMe();
}
// Banned? // Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) // if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) // || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
@@ -271,6 +271,10 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
// Disconnect offline trader.
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
{
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -280,6 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);

Some files were not shown because too many files have changed in this diff Show More