MAC disabled with Tournament Mode

Bridges TM game desc fix
This commit is contained in:
Chiss 2014-05-03 11:47:15 +10:00
parent e818662161
commit 395a5d2c08
4 changed files with 94 additions and 42 deletions

View File

@ -39,6 +39,8 @@ public class AntiHack extends MiniPlugin
public static AntiHack Instance;
private boolean _enabled = true;
public Punish Punish;
public Portal Portal;
@ -94,6 +96,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void playerMove(PlayerMoveEvent event)
{
if (!_enabled)
return;
synchronized (_antiHackLock)
{
_lastMoveEvent.put(event.getPlayer(), System.currentTimeMillis());
@ -103,6 +108,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void playerTeleport(PlayerTeleportEvent event)
{
if (!_enabled)
return;
synchronized (_antiHackLock)
{
_ignore.put(event.getPlayer(), System.currentTimeMillis() + 2000);
@ -112,6 +120,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void playerVelocity(PlayerVelocityEvent event)
{
if (!_enabled)
return;
synchronized (_antiHackLock)
{
_velocityEvent.add(event.getPlayer());
@ -121,6 +132,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void playerToggleFly(PlayerToggleFlightEvent event)
{
if (!_enabled)
return;
Player player = event.getPlayer();
synchronized (_antiHackLock)
@ -147,12 +161,18 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void playerQuit(PlayerQuitEvent event)
{
if (!_enabled)
return;
ResetAll(event.getPlayer());
}
@EventHandler
public void startIgnore(PlayerMoveEvent event)
{
if (!_enabled)
return;
Player player = event.getPlayer();
synchronized (_antiHackLock)
@ -235,6 +255,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void processOffenses(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.SEC)
return;
@ -271,6 +294,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void generateReports(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.SLOW)
return;
@ -370,6 +396,9 @@ public class AntiHack extends MiniPlugin
@EventHandler
public void cleanupPlayers(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.SLOW)
return;
@ -397,4 +426,10 @@ public class AntiHack extends MiniPlugin
{
return _offense;
}
public void SetEnabled(boolean b)
{
_enabled = b;
System.out.println("MAC Disabled");
}
}

View File

@ -50,6 +50,7 @@ import mineplex.minecraft.game.core.fire.Fire;
import mineplex.core.MiniPlugin;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.antistack.AntiStack;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.blood.Blood;
@ -122,6 +123,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_serverConfig = serverConfig;
if (serverConfig.Tournament)
{
AntiHack.Instance.SetEnabled(false);
}
//Modules
_antistack = antistack;

View File

@ -64,7 +64,7 @@ public abstract class Game implements Listener
//Game
private GameType _gameType;
private String[] _gameDesc;
protected String[] _gameDesc;
//Map
private ArrayList<String> _files;

View File

@ -156,8 +156,19 @@ public class Bridge extends TeamGame implements OreObsfucation
//Tournament
if (Manager.IsTournamentServer())
{
QuitOut = false;
_gameDesc = new String[]
{
"Gather resources and prepare for combat.",
"After 10 minutes, The Bridges will emerge.",
"Special loot is located in the center.",
"Team with the most kills wins!"
};
}
_tournament = Manager.IsTournamentServer();
}