Addition of OfflineDisconnectSameAccount configuration.
This commit is contained in:
@@ -1097,6 +1097,7 @@ public class Config
|
||||
public static boolean RESTORE_OFFLINERS;
|
||||
public static int OFFLINE_MAX_DAYS;
|
||||
public static boolean OFFLINE_DISCONNECT_FINISHED;
|
||||
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
|
||||
public static boolean OFFLINE_SET_NAME_COLOR;
|
||||
public static int OFFLINE_NAME_COLOR;
|
||||
public static boolean OFFLINE_FAME;
|
||||
@@ -3286,6 +3287,7 @@ public class Config
|
||||
RESTORE_OFFLINERS = offlineTradeConfig.getBoolean("RestoreOffliners", false);
|
||||
OFFLINE_MAX_DAYS = offlineTradeConfig.getInt("OfflineMaxDays", 10);
|
||||
OFFLINE_DISCONNECT_FINISHED = offlineTradeConfig.getBoolean("OfflineDisconnectFinished", true);
|
||||
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
|
||||
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
|
||||
|
||||
// Load PasswordChange config file (if exists)
|
||||
|
@@ -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) //
|
||||
|
@@ -206,10 +206,15 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
if (charInfopackage != null)
|
||||
{
|
||||
characterList.add(charInfopackage);
|
||||
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
|
||||
if (player != null)
|
||||
|
||||
// Disconnect offline trader.
|
||||
if (Config.OFFLINE_DISCONNECT_SAME_ACCOUNT)
|
||||
{
|
||||
Disconnection.of(player).storeMe().deleteMe();
|
||||
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
|
||||
if (player != null)
|
||||
{
|
||||
Disconnection.of(player).storeMe().deleteMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user