Changed skills to 2k gems each.

Changed power/booster to 2k gems each.

Added AntiHack perm storage of kicks.
Commented out SafeChat stuff for now.
This commit is contained in:
Jonathan Williams 2014-04-28 01:05:08 -07:00
parent 66aa7223cc
commit fd372b8418
5 changed files with 43 additions and 20 deletions

View File

@ -20,6 +20,7 @@ import mineplex.core.punish.Punish;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -29,6 +30,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.event.player.PlayerVelocityEvent;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class AntiHack extends MiniPlugin public class AntiHack extends MiniPlugin
@ -63,7 +65,7 @@ public class AntiHack extends MiniPlugin
public ArrayList<Detector> _detectors; public ArrayList<Detector> _detectors;
//private AntiHackRepository _repository; private AntiHackRepository _repository;
protected AntiHack(JavaPlugin plugin, Punish punish, Portal portal) protected AntiHack(JavaPlugin plugin, Punish punish, Portal portal)
{ {
@ -72,8 +74,8 @@ public class AntiHack extends MiniPlugin
Punish = punish; Punish = punish;
Portal = portal; Portal = portal;
//_repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name")); _repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name"));
//_repository.initialize(); _repository.initialize();
_detectors = new ArrayList<Detector>(); _detectors = new ArrayList<Detector>();
@ -295,10 +297,27 @@ public class AntiHack extends MiniPlugin
); );
UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement.")); UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement."));
ServerListPingEvent event = new ServerListPingEvent(null, Bukkit.getServer().getMotd(), Bukkit.getServer().getOnlinePlayers().length, Bukkit.getServer().getMaxPlayers());
GetPluginManager().callEvent(event);
String motd = event.getMotd();
String game = "N/A";
String map = "N/A";
String[] args = motd.split("\\|");
if (args.length > 0)
motd = args[0];
if (args.length > 2)
game = args[2];
if (args.length > 3)
map = args[3];
_repository.saveOffense(player, motd, game, map, report);
} }
//_repository.saveOffense(player, report, severity);
} }
private void ResetAll(Player player) private void ResetAll(Player player)

View File

@ -16,8 +16,8 @@ public class AntiHackRepository
private String _userName = "root"; private String _userName = "root";
private String _password = "tAbechAk3wR7tuTh"; private String _password = "tAbechAk3wR7tuTh";
private static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS AntiHack (id INT NOT NULL AUTO_INCREMENT, serverName VARCHAR(256) NOT NULL, hackType VARCHAR(256) NOT NULL, playerName VARCHAR(256) NOT NULL, hackCount INT, updated LONG, PRIMARY KEY (id), UNIQUE KEY serverName_hackType_playerName (serverName, hackType, playerName));"; private static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS AntiHack_Log (id INT NOT NULL AUTO_INCREMENT, updated LONG, playerName VARCHAR(256), motd VARCHAR(56), gameType VARCHAR(56), map VARCHAR(256), serverName VARCHAR(256), report VARCHAR(256), PRIMARY KEY (id));";
private static String UPDATE_PLAYER_OFFENSES = "REPLACE INTO AntiHack (serverName, playerName, hackType, hackCount, updated) VALUES (?, ?, ?, ?, now());"; private static String UPDATE_PLAYER_OFFENSES = "INSERT INTO AntiHack_Log (updated, playerName, motd, gameType, map, serverName, report) VALUES (now(), ?, ?, ?, ?, ?, ?);";
public AntiHackRepository(String serverName) public AntiHackRepository(String serverName)
{ {
@ -57,7 +57,7 @@ public class AntiHackRepository
} }
} }
public void saveOffense(final Player player, final String report, final String severity) public void saveOffense(final Player player, final String motd, final String game, final String map, final String report)
{ {
new Thread(new Runnable() new Thread(new Runnable()
{ {
@ -72,10 +72,12 @@ public class AntiHackRepository
preparedStatement = _connection.prepareStatement(UPDATE_PLAYER_OFFENSES); preparedStatement = _connection.prepareStatement(UPDATE_PLAYER_OFFENSES);
preparedStatement.setString(1, _serverName); preparedStatement.setString(1, player.getName());
preparedStatement.setString(2, player.getName()); preparedStatement.setString(2, motd);
preparedStatement.setString(3, report); preparedStatement.setString(3, game);
preparedStatement.setString(4, severity); preparedStatement.setString(4, map);
preparedStatement.setString(5, _serverName);
preparedStatement.setString(6, report);
preparedStatement.execute(); preparedStatement.execute();
} }

View File

@ -192,6 +192,7 @@ public class Chat extends MiniClientPlugin<ChatClient>
{ {
_playerLastMessage.put(sender.getName(), event.getMessage()); _playerLastMessage.put(sender.getName(), event.getMessage());
/*
if (event.isAsynchronous()) if (event.isAsynchronous())
{ {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
@ -202,7 +203,7 @@ public class Chat extends MiniClientPlugin<ChatClient>
JSONObject message = buildJsonChatObject(filtertype, dname, plyrname, msg, 1); JSONObject message = buildJsonChatObject(filtertype, dname, plyrname, msg, 1);
boolean activehashing = false; boolean activehashing = true;
String response = getResponseFromTwoHat(message, filtertype); String response = getResponseFromTwoHat(message, filtertype);
String display = parseResponse(response); String display = parseResponse(response);
@ -232,6 +233,7 @@ public class Chat extends MiniClientPlugin<ChatClient>
player.setDisplayName(player.getPlayerListName()); player.setDisplayName(player.getPlayerListName());
} }
} }
*/
} }
} }

View File

@ -129,7 +129,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
skillToken.Name = skill.GetName(); skillToken.Name = skill.GetName();
skillToken.Level = i + 1; skillToken.Level = i + 1;
skillToken.SalesPackage = new GameSalesPackageToken(); skillToken.SalesPackage = new GameSalesPackageToken();
skillToken.SalesPackage.Gems = 1000; skillToken.SalesPackage.Gems = 2000;
skillTokens.add(skillToken); skillTokens.add(skillToken);
} }

View File

@ -104,11 +104,11 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
AddItem(new StandardSword(this, 0, 2)); AddItem(new StandardSword(this, 0, 2));
AddItem(new StandardAxe(this, 0, 2)); AddItem(new StandardAxe(this, 0, 2));
AddItem(new BoosterSword(this, 0, 4)); AddItem(new BoosterSword(this, 2000, 4));
AddItem(new BoosterAxe(this, 0, 4)); AddItem(new BoosterAxe(this, 2000, 4));
AddItem(new PowerSword(this, 0, 4)); AddItem(new PowerSword(this, 2000, 4));
AddItem(new PowerAxe(this, 0, 4)); AddItem(new PowerAxe(this, 2000, 4));
AddItem(new StandardBow(this, 0, 1)); AddItem(new StandardBow(this, 0, 1));
} }