Bug fixes: configuration generation corrected, Join flood methods fixed, Join clone methods fixed

This commit is contained in:
Dmitry Isaenko 2021-01-18 18:16:07 +03:00
parent 8ead269844
commit dac70bfd35
5 changed files with 7 additions and 6 deletions

View file

@ -4,6 +4,7 @@ import InnaIrcBot.Commanders.EventHandler;
import InnaIrcBot.ProvidersConsumers.StreamProvider;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
public class JoinFloodHandler implements EventHandler {

View file

@ -1,7 +1,7 @@
package InnaIrcBot;
public class GlobalData {
private static final String version = "InnaIrcBot v0.8 \"Коммунарка\"";
private static final String version = "InnaIrcBot v0.9 \"Литке\"";
public static synchronized String getAppVersion(){
return String.format("%s, %s %s %s", version,
System.getProperty("os.name"),

View file

@ -22,8 +22,8 @@ public class StreamProvider {
} catch (NullPointerException npe){
System.out.println("Internal issue: StreamProvider->writeToStream() caused NullPointerException exception:\n"
+"Server: "+server
+"\nMessage: "+message
+"\n\t"+npe.getMessage());
+"\nMessage: "+message);
npe.printStackTrace();
}
}
public static synchronized void setStream(String server, Socket socket) throws IOException{

View file

@ -104,7 +104,7 @@ public class ConfigurationFile {
if (channelRules == null)
channelRules = new ArrayList<>();
Ini.Section joinFloodControlSection = channelSection.getChild("rules");
Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl");
boolean joinFloodControl = joinFloodControlSection.get("enable", boolean.class);
int joinFloodControlEventsNumber = -1;
@ -114,7 +114,7 @@ public class ConfigurationFile {
joinFloodControlTimeFrame = joinFloodControlSection.get("time frame", int.class);
}
Ini.Section joinCloneControlSection = channelSection.getChild("rules");
Ini.Section joinCloneControlSection = channelSection.getChild("JoinCloneControl");
boolean joinCloneControl = joinCloneControlSection.get("enable", boolean.class);

View file

@ -145,7 +145,7 @@ public class ConfigurationFileGenerator {
Ini.Section channelMainJoinCloneControlSection = channelMainSection.addChild("JoinCloneControl");
channelMainJoinCloneControlSection.put("enable", false);
channelMainJoinCloneControlSection.put("pattern", "^.+[0-9]+?!.*$");
channelMainJoinFloodControlSection.put("time frame", 0);
channelMainJoinCloneControlSection.put("time frame", 0);
Ini.Section linksHeaderParser = channelMainSection.addChild("ParseLinksTitles");
linksHeaderParser.put("enable", true);