diff --git a/pom.xml b/pom.xml index fa46077..f26692e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 loper InnaIrcBot - 0.8-SNAPSHOT + 0.9-SNAPSHOT jar InnaIrcBot diff --git a/src/main/java/InnaIrcBot/config/ConfigurationFile.java b/src/main/java/InnaIrcBot/config/ConfigurationFile.java index b700fc9..722debd 100644 --- a/src/main/java/InnaIrcBot/config/ConfigurationFile.java +++ b/src/main/java/InnaIrcBot/config/ConfigurationFile.java @@ -104,26 +104,35 @@ public class ConfigurationFile { if (channelRules == null) channelRules = new ArrayList<>(); - Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl"); - - boolean joinFloodControl = joinFloodControlSection.get("enable", boolean.class); + boolean joinFloodControl = false; int joinFloodControlEventsNumber = -1; int joinFloodControlTimeFrame = -1; - if (joinFloodControl){ - joinFloodControlEventsNumber = joinFloodControlSection.get("join number", int.class); - joinFloodControlTimeFrame = joinFloodControlSection.get("time frame", int.class); - } + try { + Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl"); - Ini.Section joinCloneControlSection = channelSection.getChild("JoinCloneControl"); - - boolean joinCloneControl = joinCloneControlSection.get("enable", boolean.class); + joinFloodControl = joinFloodControlSection.get("enable", boolean.class); + joinFloodControlEventsNumber = -1; + joinFloodControlTimeFrame = -1; + if (joinFloodControl){ + joinFloodControlEventsNumber = joinFloodControlSection.get("join number", int.class); + joinFloodControlTimeFrame = joinFloodControlSection.get("time frame", int.class); + } + } catch (NullPointerException ignore) {} + boolean joinCloneControl = false; int joinCloneControlTimeFrame = -1; String joinCloneControlPattern = ""; - if (joinCloneControl){ - joinCloneControlTimeFrame = joinCloneControlSection.get("time frame", int.class); - joinCloneControlPattern = joinCloneControlSection.getOrDefault("pattern", ""); - } + try { + Ini.Section joinCloneControlSection = channelSection.getChild("JoinCloneControl"); + + joinCloneControl = joinCloneControlSection.get("enable", boolean.class); + joinCloneControlTimeFrame = -1; + joinCloneControlPattern = ""; + if (joinCloneControl){ + joinCloneControlTimeFrame = joinCloneControlSection.get("time frame", int.class); + joinCloneControlPattern = joinCloneControlSection.getOrDefault("pattern", ""); + } + } catch (NullPointerException ignore) {} Profile.Section parseLinksTitlesSection = channelSection.getChild("ParseLinksTitles");