Addition of OfflineDisconnectSameAccount configuration.
This commit is contained in:
@@ -3,44 +3,41 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Option to enable or disable offline trade feature.
|
||||
# Enable -> true, Disable -> false
|
||||
OfflineTradeEnable = True
|
||||
|
||||
# Option to enable or disable offline craft feature.
|
||||
# Enable -> true, Disable -> false
|
||||
OfflineCraftEnable = True
|
||||
|
||||
# If set to True, off-line shops will be possible only peace zones.
|
||||
# Default: False
|
||||
OfflineModeInPeaceZone = True
|
||||
|
||||
# If set to True, players in off-line shop mode wont take any damage, thus they cannot be killed.
|
||||
# Default: False
|
||||
OfflineModeNoDamage = True
|
||||
|
||||
# If set to True, name color will be changed then entering offline mode
|
||||
# If set to True, name color will be changed then entering offline mode.
|
||||
OfflineSetNameColor = True
|
||||
|
||||
# Color of the name in offline mode (if OfflineSetNameColor = True)
|
||||
# Color of the name in offline mode (if OfflineSetNameColor = True).
|
||||
OfflineNameColor = 808080
|
||||
|
||||
# Allow fame for characters in offline mode
|
||||
# Enable -> true, Disable -> false
|
||||
# Allow fame for characters in offline mode.
|
||||
OfflineFame = True
|
||||
|
||||
#Restore offline traders/crafters after restart/shutdown. Default: false.
|
||||
# Restore offline traders after restart/shutdown.
|
||||
RestoreOffliners = True
|
||||
|
||||
#Do not restore offline characters, after OfflineMaxDays days spent from first restore.
|
||||
#Require server restart to disconnect expired shops.
|
||||
#0 = disabled (always restore).
|
||||
#Default: 10
|
||||
OfflineMaxDays = 10
|
||||
# Do not restore offline characters, after OfflineMaxDays days spent from first restore.
|
||||
# Require server restart to disconnect expired shops.
|
||||
# 0 = disabled (always restore).
|
||||
OfflineMaxDays = 0
|
||||
|
||||
#Disconnect shop after finished selling, buying.
|
||||
#Default: True
|
||||
# Disconnect shop after finished selling, buying.
|
||||
OfflineDisconnectFinished = True
|
||||
|
||||
#Store offline trader transactions in realtime.
|
||||
#Uses more datatabase resources, but helps if server shuts down unexpectedly.
|
||||
# Disconnect shop when character from same account logins to the game.
|
||||
OfflineDisconnectSameAccount = False
|
||||
|
||||
# Store offline trader transactions in realtime.
|
||||
# Uses more datatabase resources, but helps if server shuts down unexpectedly.
|
||||
StoreOfflineTradeInRealtime = True
|
||||
|
||||
|
||||
@@ -1147,6 +1147,7 @@ public class Config
|
||||
public static boolean RESTORE_OFFLINERS;
|
||||
public static int OFFLINE_MAX_DAYS;
|
||||
public static boolean OFFLINE_DISCONNECT_FINISHED;
|
||||
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
|
||||
public static boolean OFFLINE_SET_NAME_COLOR;
|
||||
public static int OFFLINE_NAME_COLOR;
|
||||
public static boolean OFFLINE_FAME;
|
||||
@@ -3400,6 +3401,7 @@ public class Config
|
||||
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
|
||||
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
|
||||
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
|
||||
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
|
||||
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
|
||||
|
||||
// Load PasswordChange config file (if exists)
|
||||
|
||||
@@ -102,6 +102,13 @@ public class CharacterSelect implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// Disconnect offline trader.
|
||||
final Player player = World.getInstance().getPlayer(info.getObjectId());
|
||||
if (player != null)
|
||||
{
|
||||
Disconnection.of(player).storeMe().deleteMe();
|
||||
}
|
||||
|
||||
// Banned?
|
||||
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|
||||
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|
||||
|
||||
@@ -275,10 +275,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
if (charInfopackage != null)
|
||||
{
|
||||
characterList.add(charInfopackage);
|
||||
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
|
||||
if (player != null)
|
||||
|
||||
// Disconnect offline trader.
|
||||
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
|
||||
{
|
||||
Disconnection.of(player).storeMe().deleteMe();
|
||||
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
|
||||
if (player != null)
|
||||
{
|
||||
Disconnection.of(player).storeMe().deleteMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user