This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Bobi
i import chat flood protect but idk why its dont accept config delay
i change to 10 min or 1 sec but it still same i do it in java and config but not effect
say2.java
import com.l2.gameserver.util.FloodProtectorConfig; ................... .......... .... break; case SHOUT: if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM())) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT)) { activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds."); return; } int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY())) player.sendPacket(cs); } } else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global")) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT)) { activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds."); return; } if (activeChar.getPvpKills()< Config.L2JMOD_MIN_PVP_POINTS_TO_TALK) { activeChar.sendMessage("You need "+ Integer.toString(Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)+ " pvp points to use Global chat."); return; } for (L2PcInstance player : L2World.getInstance().getAllPlayers()) { player.sendPacket(cs); } } break; case TRADE: if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM())) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT)) { activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds."); return; } if (activeChar.getPvpKills()< Config.L2JMOD_MIN_PVP_POINTS_TO_TALK) { activeChar.sendMessage("You need "+ Integer.toString(Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)+ " pvp points to use Global chat."); return; } for (L2PcInstance player : L2World.getInstance().getAllPlayers()) { player.sendPacket(cs); } } else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("limited")) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT)) { activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds."); return; } int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY())) player.sendPacket(cs); } } break; case ALL: if (_text.startsWith(".")) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT)) { activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds."); return; } case HERO_VOICE: if (activeChar.isGM()) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE)) { //Nothing here xD } for (L2PcInstance player : L2World.getInstance().getAllPlayers()) if (!BlockList.isBlocked(player, activeChar)) player.sendPacket(cs); } else if (activeChar.isHero()) { if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE)) { activeChar.sendMessage("Action failed. Heroes are only able to speak in the global channel once every 10 seconds."); return; } for (L2PcInstance player : L2World.getInstance().getAllPlayers()) if (!BlockList.isBlocked(player, activeChar)) player.sendPacket(cs); }config.java
private static void loadFloodProtectorConfigs(final Properties properties) { 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", "20000"); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20"); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10"); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5"); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1"); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "100"); 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"); } private static void loadFloodProtectorConfig(final Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval) { config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval)); config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False")); config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0")); config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none"); config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0")); }6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now