Addition of KickMissingHWID configuration.
This commit is contained in:
parent
f532bad2fb
commit
cbf7bcb229
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -752,6 +752,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1396,7 +1397,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -680,27 +680,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -761,6 +761,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1406,7 +1407,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -762,6 +762,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1419,7 +1420,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -749,6 +749,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1406,7 +1407,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -744,6 +744,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1401,7 +1402,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -744,6 +744,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1408,7 +1409,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -745,6 +745,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1430,7 +1431,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -750,6 +750,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1441,7 +1442,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -738,27 +738,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -751,6 +751,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1337,7 +1338,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -751,6 +751,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1341,7 +1342,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -751,6 +751,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1341,7 +1342,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -751,6 +751,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1341,7 +1342,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -751,6 +751,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1346,7 +1347,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -755,6 +755,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1354,7 +1355,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -718,27 +718,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
@ -162,11 +162,15 @@ RestartOnDeadlock = False
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Check if hardware information is sent upon login.
|
||||
# Players without hardware information are kicked from the game.
|
||||
# WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true.
|
||||
# Default: False
|
||||
EnableHardwareInfo = False
|
||||
|
||||
# Players without hardware information are kicked from the game.
|
||||
# Automatically set to True when MaxPlayersPerHWID > 0.
|
||||
# Default: False
|
||||
KickMissingHWID = False
|
||||
|
||||
# Maximum number of players per HWID allowed to enter game.
|
||||
# Default: 0 (unlimited)
|
||||
MaxPlayersPerHWID = 0
|
||||
|
@ -760,6 +760,7 @@ public class Config
|
||||
public static int BACKUP_DAYS;
|
||||
public static int MAXIMUM_ONLINE_USERS;
|
||||
public static boolean HARDWARE_INFO_ENABLED;
|
||||
public static boolean KICK_MISSING_HWID;
|
||||
public static int MAX_PLAYERS_PER_HWID;
|
||||
public static Pattern CHARNAME_TEMPLATE_PATTERN;
|
||||
public static String PET_NAME_TEMPLATE;
|
||||
@ -1355,7 +1356,12 @@ public class Config
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
if (MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
KICK_MISSING_HWID = true;
|
||||
}
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
|
@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Check max players.
|
||||
if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
if (Config.KICK_MISSING_HWID && (hwInfo == null))
|
||||
{
|
||||
if (hwInfo == null)
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else if (Config.MAX_PLAYERS_PER_HWID > 0)
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
int count = 0;
|
||||
for (PlayerInstance plr : World.getInstance().getPlayers())
|
||||
{
|
||||
if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo)))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count >= Config.MAX_PLAYERS_PER_HWID)
|
||||
{
|
||||
Disconnection.of(client).defaultSequence(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user