Add an enjin chargeback command and fix punishing in support servers

This commit is contained in:
AlexTheCoder 2016-09-03 15:42:32 -04:00 committed by cnr
parent b3478d70e8
commit 29bb2a3895
2 changed files with 36 additions and 17 deletions

View File

@ -256,7 +256,15 @@ public class PunishPage extends CraftInventoryCustom implements Listener
, 1, false, true), new PunishButton(this, Category.Hacking, 2, true, getDuration(Category.Hacking, 2, offenseMap)));
int flightSeverity = (Managers.get(AntiHack.class).isStrict() ? 3 : 2);
int flightSeverity = 2;
try
{
if (Managers.get(AntiHack.class).isStrict())
{
flightSeverity = 3;
}
}
catch (Exception e) {}
AddButton(41, new ShopItem(Material.INK_SACK, (byte)1, "Severity 3",new String[]

View File

@ -1,5 +1,19 @@
package mineplex.enjinTranslator;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.AbstractMap;
import java.util.Date;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
@ -10,24 +24,12 @@ import mineplex.core.common.util.NautHashMap;
import mineplex.core.donation.DonationManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.powerplayclub.PowerPlayClubRepository;
import mineplex.core.punish.Category;
import mineplex.core.punish.Punish;
import mineplex.core.server.util.TransactionResponse;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.enjinTranslator.purchase.PurchaseManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.AbstractMap;
import java.util.Date;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.UUID;
public class Enjin extends MiniPlugin implements CommandExecutor
{
@ -36,6 +38,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
private InventoryManager _inventoryManager;
private PurchaseManager _purchaseManager;
private PowerPlayClubRepository _powerPlayClubRepository;
private Punish _punish;
private NautHashMap<String, Entry<UUID, Long>> _cachedUUIDs = new NautHashMap<String, Entry<UUID, Long>>();
private static Object _commandLock = new Object();
@ -44,13 +47,14 @@ public class Enjin extends MiniPlugin implements CommandExecutor
private SimpleDateFormat _dateFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
public Enjin(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager)
public Enjin(EnjinTranslator plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager)
{
super("Enjin", plugin);
_clientManager = clientManager;
_donationManager = donationManager;
_inventoryManager = inventoryManager;
_punish = new Punish(plugin, plugin.GetWebServerAddress(), clientManager);
_purchaseManager = new PurchaseManager(plugin);
_powerPlayClubRepository = new PowerPlayClubRepository(plugin, clientManager);
@ -115,7 +119,14 @@ public class Enjin extends MiniPlugin implements CommandExecutor
final UUID playerUUID = uuid;
_cachedUUIDs.put(name, new AbstractMap.SimpleEntry<UUID, Long>(playerUUID, System.currentTimeMillis() + 240000));
if (args[0].equalsIgnoreCase("chargeback"))
{
_punish.AddPunishment(name, Category.Other, "Chargeback", "Strutt20", 1, true, -1, true);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " was banned for charging back!");
return;
}
if (!checkForClansPurchase(args, name, client))
{
if (!checkForBoosterPurchase(args, name, playerUUID, client))