fixed memory leak in antihack

This commit is contained in:
Chiss 2013-11-01 10:40:33 +11:00
parent 08497e474d
commit c72f1337e8
4 changed files with 27 additions and 2 deletions

View File

@ -295,7 +295,11 @@ public class AntiHack extends MiniPlugin
private void ResetAll(Player player)
{
_ignore.remove(player);
_velocityEvent.remove(player);
_lastMoveEvent.remove(player);
_offense.remove(player);
_suspicion.remove(player);
for (Detector detector : _detectors)
detector.Reset(player);

View File

@ -1,17 +1,21 @@
package nautilus.game.arcade.game.games.paintball;
import java.util.HashSet;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EnderPearl;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import mineplex.core.common.util.UtilBlock;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
@ -21,6 +25,8 @@ import nautilus.game.arcade.kit.Kit;
public class Paintball extends TeamGame
{
private HashSet<StuntDouble> _doubles = new HashSet<StuntDouble>();
public Paintball(ArcadeManager manager)
{
super(manager, GameType.Paintball,
@ -79,4 +85,18 @@ public class Paintball extends TeamGame
if (color == 3) loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 8);
else loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 10);
}
@EventHandler
public void DamageOut(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
event.SetCancelled("PAINTBALLZ");
_doubles.add(new StuntDouble(this, damagee));
}
}

View File

@ -28,7 +28,8 @@ public class KitRifle extends Kit
new Perk[]
{
new PerkPaintballRifle()
new PerkPaintballRifle(),
new PerkSpeed(0)
},
EntityType.ZOMBIE,
new ItemStack(Material.IRON_BARDING));

View File

@ -29,7 +29,7 @@ public class KitShotgun extends Kit
new Perk[]
{
new PerkPaintballShotgun(),
new PerkSpeed(0)
new PerkSpeed(1)
},
EntityType.ZOMBIE,
new ItemStack(Material.GOLD_BARDING));