forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
954 B
31 lines
954 B
2 years ago
|
package engine.util;
|
||
3 years ago
|
|
||
3 years ago
|
import engine.gameManager.ConfigManager;
|
||
3 years ago
|
import engine.gameManager.DbManager;
|
||
|
import engine.objects.Group;
|
||
|
import engine.objects.PlayerCharacter;
|
||
|
import org.pmw.tinylog.Logger;
|
||
|
|
||
|
public enum KeyCloneAudit {
|
||
|
KEYCLONEAUDIT;
|
||
|
|
||
2 years ago
|
public void audit(PlayerCharacter player, Group group) {
|
||
3 years ago
|
|
||
|
int machineCount = 0;
|
||
|
String machineID;
|
||
|
|
||
|
machineID = player.getClientConnection().machineID;
|
||
|
|
||
|
for (PlayerCharacter member : group.getMembers())
|
||
|
if (machineID.equals(member.getClientConnection().machineID))
|
||
|
machineCount = machineCount + 1;
|
||
|
|
||
3 years ago
|
if (machineCount > Integer.parseInt(ConfigManager.MB_WORLD_KEYCLONE_MAX.getValue())) {
|
||
3 years ago
|
Logger.error("Keyclone detected from: " + player.getAccount().getUname() +
|
||
|
" with machine count of: " + machineCount);
|
||
|
DbManager.AccountQueries.SET_TRASH(machineID);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|