Simplified flood protector methods.

This commit is contained in:
MobiusDevelopment
2021-11-09 16:01:26 +00:00
parent e3691a48d9
commit 6da66f9503
1252 changed files with 1977 additions and 6239 deletions

View File

@@ -24,13 +24,6 @@ FloodProtectorRollDicePunishmentLimit = 0
FloodProtectorRollDicePunishmentType = none
FloodProtectorRollDicePunishmentTime = 0
# Firework - firework flooding
FloodProtectorFireworkInterval = 42
FloodProtectorFireworkLogFlooding = False
FloodProtectorFireworkPunishmentLimit = 0
FloodProtectorFireworkPunishmentType = none
FloodProtectorFireworkPunishmentTime = 0
# ItemPetSummon - item summoning and pet mounting flooding
FloodProtectorItemPetSummonInterval = 16
FloodProtectorItemPetSummonLogFlooding = False
@@ -94,13 +87,6 @@ FloodProtectorManufacturePunishmentLimit = 0
FloodProtectorManufacturePunishmentType = none
FloodProtectorManufacturePunishmentTime = 0
# Manor
FloodProtectorManorInterval = 30
FloodProtectorManorLogFlooding = False
FloodProtectorManorPunishmentLimit = 0
FloodProtectorManorPunishmentType = none
FloodProtectorManorPunishmentTime = 0
# SendMail - sending mail interval, 10s on retail
FloodProtectorSendMailInterval = 100
FloodProtectorSendMailLogFlooding = False

View File

@@ -72,7 +72,7 @@ public class ItemAuctionLink implements IBypassHandler
final String cmd = st.nextToken();
if ("show".equalsIgnoreCase(cmd))
{
if (!player.getFloodProtectors().getItemAuction().tryPerformAction("RequestInfoItemAuction"))
if (!player.getClient().getFloodProtectors().canUseItemAuction())
{
return false;
}

View File

@@ -56,7 +56,7 @@ public class ChatHeroVoice implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return;
}
if (!activeChar.getFloodProtectors().getHeroVoice().tryPerformAction("hero voice"))
if (!activeChar.getClient().getFloodProtectors().canUseHeroVoice())
{
activeChar.sendMessage("Action failed. Heroes are only able to speak in the global channel once every 10 seconds.");
return;

View File

@@ -89,7 +89,7 @@ public class ChatShout implements IChatHandler
}
else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global"))
{
if (!activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS) && !activeChar.getFloodProtectors().getGlobalChat().tryPerformAction("global chat"))
if (!activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS) && !activeChar.getClient().getFloodProtectors().canUseGlobalChat())
{
activeChar.sendMessage("Do not spam shout channel.");
return;

View File

@@ -89,7 +89,7 @@ public class ChatTrade implements IChatHandler
}
else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("global"))
{
if (!activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS) && !activeChar.getFloodProtectors().getGlobalChat().tryPerformAction("global chat"))
if (!activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS) && !activeChar.getClient().getFloodProtectors().canUseGlobalChat())
{
activeChar.sendMessage("Do not spam trade channel.");
return;

View File

@@ -84,14 +84,10 @@ public class RollingDice implements IItemHandler
return true;
}
/**
* @param player
* @return
*/
private int rollDice(PlayerInstance player)
{
// Check if the dice is ready
if (!player.getFloodProtectors().getRollDice().tryPerformAction("roll dice"))
if (!player.getClient().getFloodProtectors().canRollDice())
{
return 0;
}

View File

@@ -39,7 +39,7 @@ public class SummonItems extends ItemSkillsTemplate
}
final PlayerInstance player = playable.getActingPlayer();
if (!player.getFloodProtectors().getItemPetSummon().tryPerformAction("summon items") || (player.getBlockCheckerArena() != -1) || player.inObserverMode() || player.isAllSkillsDisabled() || player.isCastingNow())
if (!player.getClient().getFloodProtectors().canUsePetSummonItem() || (player.getBlockCheckerArena() != -1) || player.inObserverMode() || player.isAllSkillsDisabled() || player.isCastingNow())
{
return false;
}