Simplified flood protector methods.
This commit is contained in:
@ -596,7 +596,6 @@ public class Config
|
||||
// --------------------------------------------------
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
|
||||
@ -606,7 +605,6 @@ public class Config
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
|
||||
public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_AUCTION;
|
||||
@ -1387,7 +1385,6 @@ public class Config
|
||||
{
|
||||
FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
|
||||
FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
|
||||
FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
|
||||
FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
|
||||
FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
|
||||
FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
|
||||
@ -1397,7 +1394,6 @@ public class Config
|
||||
FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
|
||||
FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
|
||||
FLOOD_PROTECTOR_MANUFACTURE = new FloodProtectorConfig("ManufactureFloodProtector");
|
||||
FLOOD_PROTECTOR_MANOR = new FloodProtectorConfig("ManorFloodProtector");
|
||||
FLOOD_PROTECTOR_SENDMAIL = new FloodProtectorConfig("SendMailFloodProtector");
|
||||
FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector");
|
||||
FLOOD_PROTECTOR_ITEM_AUCTION = new FloodProtectorConfig("ItemAuctionFloodProtector");
|
||||
@ -3753,7 +3749,6 @@ public class Config
|
||||
{
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 4);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", 42);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", 16);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", 100);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5);
|
||||
@ -3763,7 +3758,6 @@ public class Config
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", 1);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", 3);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", 30);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", 100);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", 30);
|
||||
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_AUCTION, "ItemAuction", 9);
|
||||
|
@ -360,7 +360,6 @@ import org.l2jmobius.gameserver.taskmanager.PlayerAutoSaveTaskManager;
|
||||
import org.l2jmobius.gameserver.taskmanager.PvpFlagTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Broadcast;
|
||||
import org.l2jmobius.gameserver.util.EnumIntBitmask;
|
||||
import org.l2jmobius.gameserver.util.FloodProtectors;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
@ -12092,11 +12091,6 @@ public class PlayerInstance extends Playable
|
||||
return _isInHideoutSiege;
|
||||
}
|
||||
|
||||
public FloodProtectors getFloodProtectors()
|
||||
{
|
||||
return _client.getFloodProtectors();
|
||||
}
|
||||
|
||||
public boolean isFlyingMounted()
|
||||
{
|
||||
return checkTransformed(Transform::isFlying);
|
||||
|
@ -54,7 +54,7 @@ public class Action implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if (!client.getFloodProtectors().getPlayerAction().tryPerformAction("PlayerAction"))
|
||||
if (!client.getFloodProtectors().canPerformPlayerAction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class AttackRequest implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if (!client.getFloodProtectors().getPlayerAction().tryPerformAction("PlayerAction"))
|
||||
if (!client.getFloodProtectors().canPerformPlayerAction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class CharacterDelete implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
// if (!client.getFloodProtectors().getCharacterSelect().tryPerformAction("CharacterDelete"))
|
||||
// if (!client.getFloodProtectors().canSelectCharacter())
|
||||
// {
|
||||
// client.sendPacket(new CharDeleteFail(CharacterDeleteFailType.UNKNOWN));
|
||||
// return;
|
||||
|
@ -41,7 +41,7 @@ public class CharacterRestore implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if (!client.getFloodProtectors().getCharacterSelect().tryPerformAction("CharacterRestore"))
|
||||
if (!client.getFloodProtectors().canSelectCharacter())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class CharacterSelect implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if (!client.getFloodProtectors().getCharacterSelect().tryPerformAction("CharacterSelect"))
|
||||
if (!client.getFloodProtectors().canSelectCharacter())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getMultiSell().tryPerformAction("multisell choose"))
|
||||
if (!client.getFloodProtectors().canUseMultiSell())
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
|
@ -50,7 +50,7 @@ public class RequestBidItemAuction implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// can't use auction fp here
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("auction"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are bidding too fast.");
|
||||
return;
|
||||
|
@ -82,7 +82,7 @@ public class RequestBuyItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("buy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are buying too fast.");
|
||||
return;
|
||||
|
@ -83,7 +83,7 @@ public class RequestBuySeed implements IClientIncomingPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (!client.getFloodProtectors().getManor().tryPerformAction("BuySeed"))
|
||||
else if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are buying seeds too fast!");
|
||||
return;
|
||||
|
@ -121,7 +121,7 @@ public class RequestBypassToServer implements IClientIncomingPacket
|
||||
}
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getServerBypass().tryPerformAction(_command))
|
||||
if (!client.getFloodProtectors().canUseServerBypass())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class RequestCancelPostAttachment implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("cancelpost"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class RequestCrystallizeItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!client.getFloodProtectors().getTransaction().tryPerformAction("crystallize"))
|
||||
// if (!client.getFloodProtectors().canPerformTransaction())
|
||||
// {
|
||||
// player.sendMessage("You are crystallizing too fast.");
|
||||
// return;
|
||||
|
@ -72,7 +72,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("destroy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are destroying items too fast.");
|
||||
return;
|
||||
|
@ -68,7 +68,7 @@ public class RequestDropItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Flood protect drop to avoid packet lag
|
||||
if (!client.getFloodProtectors().getDropItem().tryPerformAction("drop item"))
|
||||
if (!client.getFloodProtectors().canDropItem())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class RequestGetItemFromPet implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("getfrompet"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You get items from pet too fast.");
|
||||
return;
|
||||
|
@ -52,7 +52,7 @@ public class RequestGiveItemToPet implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("giveitemtopet"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are giving items to pet too fast.");
|
||||
return;
|
||||
|
@ -52,7 +52,7 @@ public class RequestHennaEquip implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("HennaEquip"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class RequestHennaRemove implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("HennaRemove"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
client.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
|
@ -47,7 +47,7 @@ public class RequestInfoItemAuction implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getItemAuction().tryPerformAction("RequestInfoItemAuction"))
|
||||
if (!client.getFloodProtectors().canUseItemAuction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class RequestPackageSend implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("deposit"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You depositing items too fast.");
|
||||
return;
|
||||
|
@ -50,7 +50,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getUseItem().tryPerformAction("pet use item"))
|
||||
if (!client.getFloodProtectors().canUseItem())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class RequestPostAttachment implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("getattach"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class RequestPreviewItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("buy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are buying too fast.");
|
||||
return;
|
||||
|
@ -91,7 +91,7 @@ public class RequestPrivateStoreBuy implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestorebuy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are buying items too fast.");
|
||||
return;
|
||||
|
@ -96,7 +96,7 @@ public class RequestPrivateStoreSell implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestoresell"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are selling items too fast.");
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ public class RequestRecipeBookDestroy implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("RecipeDestroy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class RequestRecipeItemMakeSelf implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getManufacture().tryPerformAction("RecipeMakeSelf"))
|
||||
if (!client.getFloodProtectors().canManufacture())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class RequestRecipeShopMakeItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getManufacture().tryPerformAction("RecipeShopMake"))
|
||||
if (!client.getFloodProtectors().canManufacture())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class RequestRefundItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("refund"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are using refund too fast.");
|
||||
return;
|
||||
|
@ -58,7 +58,7 @@ public class RequestRejectPostAttachment implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("rejectattach"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public class RequestSellItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("buy"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are buying too fast.");
|
||||
return;
|
||||
|
@ -249,7 +249,7 @@ public class RequestSendPost implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getSendMail().tryPerformAction("sendmail"))
|
||||
if (!client.getFloodProtectors().canSendMail())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_PREVIOUS_MAIL_WAS_FORWARDED_LESS_THAN_10_SEC_AGO_AND_THIS_CANNOT_BE_FORWARDED);
|
||||
return;
|
||||
|
@ -40,7 +40,7 @@ public class RequestTargetActionMenu implements IClientIncomingPacket
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if (!client.getFloodProtectors().getPlayerAction().tryPerformAction("PlayerAction"))
|
||||
if (!client.getFloodProtectors().canPerformPlayerAction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class SendWareHouseDepositList implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("deposit"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are depositing items too fast.");
|
||||
return;
|
||||
|
@ -76,7 +76,7 @@ public class SendWareHouseWithDrawList implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("withdraw"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are withdrawing items too fast.");
|
||||
return;
|
||||
|
@ -46,7 +46,7 @@ public class TradeDone implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.getFloodProtectors().getTransaction().tryPerformAction("trade"))
|
||||
if (!client.getFloodProtectors().canPerformTransaction())
|
||||
{
|
||||
player.sendMessage("You are trading too fast.");
|
||||
return;
|
||||
|
@ -74,7 +74,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Flood protect UseItem
|
||||
if (!client.getFloodProtectors().getUseItem().tryPerformAction("use item"))
|
||||
if (!client.getFloodProtectors().canUseItem())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class RequestCrystallizeEstimate implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!client.getFloodProtectors().getTransaction().tryPerformAction("crystallize"))
|
||||
// if (!client.getFloodProtectors().canPerformTransaction())
|
||||
// {
|
||||
// player.sendMessage("You are crystallizing too fast.");
|
||||
// return;
|
||||
|
@ -41,7 +41,7 @@ public class RequestCrystallizeItemCancel implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!client.getFloodProtectors().getTransaction().tryPerformAction("crystallize"))
|
||||
// if (!client.getFloodProtectors().canPerformTransaction())
|
||||
// {
|
||||
// player.sendMessage("You are crystallizing too fast.");
|
||||
// return;
|
||||
|
@ -82,10 +82,9 @@ public class FloodProtectorAction
|
||||
|
||||
/**
|
||||
* Checks whether the request is flood protected or not.
|
||||
* @param command command issued or short command description
|
||||
* @return true if action is allowed, otherwise false
|
||||
*/
|
||||
public boolean tryPerformAction(String command)
|
||||
public boolean canPerformAction()
|
||||
{
|
||||
if ((_client.getPlayer() != null) && _client.getPlayer().canOverrideCond(PlayerCondOverride.FLOOD_CONDITIONS))
|
||||
{
|
||||
@ -97,7 +96,7 @@ public class FloodProtectorAction
|
||||
{
|
||||
if (_config.LOG_FLOODING && !_logged && LOGGER.isLoggable(Level.WARNING))
|
||||
{
|
||||
log(" called command ", command, " ~", String.valueOf((_config.FLOOD_PROTECTION_INTERVAL - (_nextGameTick - curTick)) * GameTimeTaskManager.MILLIS_IN_TICK), " ms after previous command");
|
||||
log(" called command ", _config.FLOOD_PROTECTOR_TYPE, " ~", String.valueOf((_config.FLOOD_PROTECTION_INTERVAL - (_nextGameTick - curTick)) * GameTimeTaskManager.MILLIS_IN_TICK), " ms after previous command");
|
||||
_logged = true;
|
||||
}
|
||||
|
||||
|
@ -25,73 +25,20 @@ import org.l2jmobius.gameserver.network.GameClient;
|
||||
*/
|
||||
public class FloodProtectors
|
||||
{
|
||||
/**
|
||||
* Use-item flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _useItem;
|
||||
/**
|
||||
* Roll-dice flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _rollDice;
|
||||
/**
|
||||
* Firework flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _firework;
|
||||
/**
|
||||
* Item-pet-summon flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _itemPetSummon;
|
||||
/**
|
||||
* Hero-voice flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _heroVoice;
|
||||
/**
|
||||
* Global-chat flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _globalChat;
|
||||
/**
|
||||
* Subclass flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _subclass;
|
||||
/**
|
||||
* Drop-item flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _dropItem;
|
||||
/**
|
||||
* Server-bypass flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _serverBypass;
|
||||
/**
|
||||
* Multisell flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _multiSell;
|
||||
/**
|
||||
* Transaction flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _transaction;
|
||||
/**
|
||||
* Manufacture flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _manufacture;
|
||||
/**
|
||||
* Manor flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _manor;
|
||||
/**
|
||||
* Send mail flood protector.
|
||||
*/
|
||||
private final FloodProtectorAction _sendMail;
|
||||
/**
|
||||
* Character Select protector
|
||||
*/
|
||||
private final FloodProtectorAction _characterSelect;
|
||||
/**
|
||||
* Item Auction
|
||||
*/
|
||||
private final FloodProtectorAction _itemAuction;
|
||||
/**
|
||||
* Player Action
|
||||
*/
|
||||
private final FloodProtectorAction _playerAction;
|
||||
|
||||
/**
|
||||
@ -103,7 +50,6 @@ public class FloodProtectors
|
||||
super();
|
||||
_useItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_USE_ITEM);
|
||||
_rollDice = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ROLL_DICE);
|
||||
_firework = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_FIREWORK);
|
||||
_itemPetSummon = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
|
||||
_heroVoice = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_HERO_VOICE);
|
||||
_globalChat = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
|
||||
@ -113,162 +59,84 @@ public class FloodProtectors
|
||||
_multiSell = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MULTISELL);
|
||||
_transaction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_TRANSACTION);
|
||||
_manufacture = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANUFACTURE);
|
||||
_manor = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANOR);
|
||||
_sendMail = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SENDMAIL);
|
||||
_characterSelect = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_CHARACTER_SELECT);
|
||||
_itemAuction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ITEM_AUCTION);
|
||||
_playerAction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_PLAYER_ACTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_useItem}.
|
||||
* @return {@link #_useItem}
|
||||
*/
|
||||
public FloodProtectorAction getUseItem()
|
||||
public boolean canUseItem()
|
||||
{
|
||||
return _useItem;
|
||||
return _useItem.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_rollDice}.
|
||||
* @return {@link #_rollDice}
|
||||
*/
|
||||
public FloodProtectorAction getRollDice()
|
||||
public boolean canRollDice()
|
||||
{
|
||||
return _rollDice;
|
||||
return _rollDice.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_firework}.
|
||||
* @return {@link #_firework}
|
||||
*/
|
||||
public FloodProtectorAction getFirework()
|
||||
public boolean canUsePetSummonItem()
|
||||
{
|
||||
return _firework;
|
||||
return _itemPetSummon.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_itemPetSummon}.
|
||||
* @return {@link #_itemPetSummon}
|
||||
*/
|
||||
public FloodProtectorAction getItemPetSummon()
|
||||
public boolean canUseHeroVoice()
|
||||
{
|
||||
return _itemPetSummon;
|
||||
return _heroVoice.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_heroVoice}.
|
||||
* @return {@link #_heroVoice}
|
||||
*/
|
||||
public FloodProtectorAction getHeroVoice()
|
||||
public boolean canUseGlobalChat()
|
||||
{
|
||||
return _heroVoice;
|
||||
return _globalChat.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_globalChat}.
|
||||
* @return {@link #_globalChat}
|
||||
*/
|
||||
public FloodProtectorAction getGlobalChat()
|
||||
public boolean canChangeSubclass()
|
||||
{
|
||||
return _globalChat;
|
||||
return _subclass.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_subclass}.
|
||||
* @return {@link #_subclass}
|
||||
*/
|
||||
public FloodProtectorAction getSubclass()
|
||||
public boolean canDropItem()
|
||||
{
|
||||
return _subclass;
|
||||
return _dropItem.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_dropItem}.
|
||||
* @return {@link #_dropItem}
|
||||
*/
|
||||
public FloodProtectorAction getDropItem()
|
||||
public boolean canUseServerBypass()
|
||||
{
|
||||
return _dropItem;
|
||||
return _serverBypass.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_serverBypass}.
|
||||
* @return {@link #_serverBypass}
|
||||
*/
|
||||
public FloodProtectorAction getServerBypass()
|
||||
public boolean canUseMultiSell()
|
||||
{
|
||||
return _serverBypass;
|
||||
return _multiSell.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #_multiSell}
|
||||
*/
|
||||
public FloodProtectorAction getMultiSell()
|
||||
public boolean canPerformTransaction()
|
||||
{
|
||||
return _multiSell;
|
||||
return _transaction.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_transaction}.
|
||||
* @return {@link #_transaction}
|
||||
*/
|
||||
public FloodProtectorAction getTransaction()
|
||||
public boolean canManufacture()
|
||||
{
|
||||
return _transaction;
|
||||
return _manufacture.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_manufacture}.
|
||||
* @return {@link #_manufacture}
|
||||
*/
|
||||
public FloodProtectorAction getManufacture()
|
||||
public boolean canSendMail()
|
||||
{
|
||||
return _manufacture;
|
||||
return _sendMail.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_manor}.
|
||||
* @return {@link #_manor}
|
||||
*/
|
||||
public FloodProtectorAction getManor()
|
||||
public boolean canSelectCharacter()
|
||||
{
|
||||
return _manor;
|
||||
return _characterSelect.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_sendMail}.
|
||||
* @return {@link #_sendMail}
|
||||
*/
|
||||
public FloodProtectorAction getSendMail()
|
||||
public boolean canUseItemAuction()
|
||||
{
|
||||
return _sendMail;
|
||||
return _itemAuction.canPerformAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_characterSelect}.
|
||||
* @return {@link #_characterSelect}
|
||||
*/
|
||||
public FloodProtectorAction getCharacterSelect()
|
||||
public boolean canPerformPlayerAction()
|
||||
{
|
||||
return _characterSelect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_itemAuction}.
|
||||
* @return {@link #_itemAuction}
|
||||
*/
|
||||
public FloodProtectorAction getItemAuction()
|
||||
{
|
||||
return _itemAuction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link #_playerAction}.
|
||||
* @return {@link #_playerAction}
|
||||
*/
|
||||
public FloodProtectorAction getPlayerAction()
|
||||
{
|
||||
return _playerAction;
|
||||
return _playerAction.canPerformAction();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user