mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 06:28:52 +00:00
commit
e8c05e064f
3 files changed
+23
-9
No files matched your search
@@ -205,7 +205,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
@Override
|
@Override
|
||||||
public int getValue()
|
public int getValue()
|
||||||
{
|
{
|
||||||
return listener.getCheats(type);
|
return EventListener.getCheats(type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
listener.resetCheck(type);
|
listener.resetCheck(type);
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ public class CommandHandler implements CommandExecutor
|
|||||||
}
|
}
|
||||||
if (cont)
|
if (cont)
|
||||||
{
|
{
|
||||||
List<CheckType> l = new ArrayList();
|
List<CheckType> l = new ArrayList<CheckType>();
|
||||||
for(CheckType type : CheckType.values())
|
for(CheckType type : CheckType.values())
|
||||||
{
|
{
|
||||||
if(type.getUses(user.getName()) > 0)
|
if(type.getUses(user.getName()) > 0)
|
||||||
|
|||||||
@@ -899,7 +899,7 @@ public class Backend
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logChat(Player player)
|
public void logChat(final Player player)
|
||||||
{
|
{
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
if (chatLevel.get(name) == null)
|
if (chatLevel.get(name) == null)
|
||||||
@@ -910,7 +910,17 @@ public class Backend
|
|||||||
{
|
{
|
||||||
int amount = chatLevel.get(name) + 1;
|
int amount = chatLevel.get(name) + 1;
|
||||||
logEvent(chatLevel, player, amount, magic.CHAT_MIN);
|
logEvent(chatLevel, player, amount, magic.CHAT_MIN);
|
||||||
checkChatLevel(player, amount);
|
if (checkChatLevel(player, amount))
|
||||||
|
{
|
||||||
|
micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
processChatSpammer(player);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -930,7 +940,7 @@ public class Backend
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
logEvent(oldMessage, player, lastMessage.get(name), magic.CHAT_REPEAT_MIN);
|
logEvent(oldMessage, player, lastMessage.get(name), magic.CHAT_REPEAT_MIN);
|
||||||
logEvent(oldMessage, player, msg, magic.CHAT_REPEAT_MIN);
|
logEvent(lastMessage, player, msg, magic.CHAT_REPEAT_MIN);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1176,8 +1186,7 @@ public class Backend
|
|||||||
return isMovingExempt(player) || justVelocity(player);
|
return isMovingExempt(player) || justVelocity(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
private <E> void logEvent(final Map<String, E> map, final Player player, final E obj, long time)
|
||||||
private void logEvent(@SuppressWarnings("rawtypes") final Map map, final Player player, final Object obj, long time)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
map.put(player.getName(), obj);
|
map.put(player.getName(), obj);
|
||||||
@@ -1234,9 +1243,14 @@ public class Backend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkChatLevel(Player player, int amount)
|
private boolean checkChatLevel(Player player, int amount)
|
||||||
{
|
{
|
||||||
if (amount >= magic.CHAT_KICK_LEVEL)
|
return amount >= magic.CHAT_KICK_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processChatSpammer(Player player)
|
||||||
|
{
|
||||||
|
if (player != null && player.isOnline())
|
||||||
{
|
{
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
int kick;
|
int kick;
|
||||||
|
|||||||
Reference in new issue
Block a user