mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Fix for issue #47 - only remove values from maps if they are the same as when we put it there.
This commit is contained in:
1 parent
aa7e9b733e
commit
f6ddb4c9b8
3 files changed
+13
-10
No files matched your search
@@ -207,10 +207,10 @@ public class Anticheat extends JavaPlugin
|
||||
logger.log(Level.INFO, "Data for "+player.getName()+" re-applied from flatfile");
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
logger.log(Level.INFO, "Finished loading.");
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
logger.log(Level.INFO, "Finished loading.");
|
||||
}
|
||||
}
|
||||
|
||||
private void saveFile(String file, String url)
|
||||
|
||||
@@ -83,7 +83,7 @@ public class AnticheatManager
|
||||
{
|
||||
if(getConfiguration().logConsole())
|
||||
{
|
||||
LOGGER.info(ChatColor.stripColor(message)); //This is temporary. Is something wrong with jline?
|
||||
LOGGER.info("[AntiCheat] "+ChatColor.stripColor(message)); //This is temporary. Is something wrong with jline?
|
||||
}
|
||||
if(getConfiguration().getFileLogLevel() == LOG_LEVEL_HIGH)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,6 @@ public class Backend
|
||||
|
||||
private AnticheatManager micromanage = null;
|
||||
private List<String> droppedItem = new ArrayList<String>();
|
||||
private List<String> animated = new ArrayList<String>();
|
||||
private List<String> movingExempt = new ArrayList<String>();
|
||||
private List<String> brokenBlock = new ArrayList<String>();
|
||||
private List<String> placedBlock = new ArrayList<String>();
|
||||
@@ -150,6 +149,7 @@ public class Backend
|
||||
private Map<String,Integer> projectilesShot = new HashMap<String,Integer>();
|
||||
private Map<String,Long> velocitized = new HashMap<String,Long>();
|
||||
private Map<String,Integer> velocitytrack = new HashMap<String,Integer>();
|
||||
private Map<String,Location> animated = new HashMap<String,Location>();
|
||||
|
||||
public Backend(AnticheatManager instance)
|
||||
{
|
||||
@@ -808,7 +808,7 @@ public class Backend
|
||||
|
||||
public void logAnimation(final Player player)
|
||||
{
|
||||
logEvent(animated,player,ANIMATION_MIN);
|
||||
logEvent(animated,player,player.getLocation(),ANIMATION_MIN);
|
||||
increment(player,blockPunches,BLOCK_PUNCH_MIN);
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ public class Backend
|
||||
|
||||
public boolean justAnimated(Player player)
|
||||
{
|
||||
return animated.contains(player.getName());
|
||||
return animated.containsKey(player.getName());
|
||||
}
|
||||
|
||||
public void logProjectile(final Player player, final EventListener e)
|
||||
@@ -929,13 +929,16 @@ public class Backend
|
||||
@SuppressWarnings("unchecked")
|
||||
private void logEvent(@SuppressWarnings("rawtypes") final Map map, final Player player, final Object obj, long time)
|
||||
{
|
||||
map.put(player,obj);
|
||||
map.put(player.getName(),obj);
|
||||
micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
map.remove(player);
|
||||
if(map.get(player.getName()) == obj)
|
||||
{
|
||||
map.remove(player.getName());
|
||||
}
|
||||
}
|
||||
}, time);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user