Bug fixes: configuration generation corrected, Join flood methods fixed, Join clone methods fixed
This commit is contained in:
parent
8ead269844
commit
dac70bfd35
5 changed files with 7 additions and 6 deletions
|
@ -4,6 +4,7 @@ import InnaIrcBot.Commanders.EventHandler;
|
||||||
import InnaIrcBot.ProvidersConsumers.StreamProvider;
|
import InnaIrcBot.ProvidersConsumers.StreamProvider;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class JoinFloodHandler implements EventHandler {
|
public class JoinFloodHandler implements EventHandler {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package InnaIrcBot;
|
package InnaIrcBot;
|
||||||
|
|
||||||
public class GlobalData {
|
public class GlobalData {
|
||||||
private static final String version = "InnaIrcBot v0.8 \"Коммунарка\"";
|
private static final String version = "InnaIrcBot v0.9 \"Литке\"";
|
||||||
public static synchronized String getAppVersion(){
|
public static synchronized String getAppVersion(){
|
||||||
return String.format("%s, %s %s %s", version,
|
return String.format("%s, %s %s %s", version,
|
||||||
System.getProperty("os.name"),
|
System.getProperty("os.name"),
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class StreamProvider {
|
||||||
} catch (NullPointerException npe){
|
} catch (NullPointerException npe){
|
||||||
System.out.println("Internal issue: StreamProvider->writeToStream() caused NullPointerException exception:\n"
|
System.out.println("Internal issue: StreamProvider->writeToStream() caused NullPointerException exception:\n"
|
||||||
+"Server: "+server
|
+"Server: "+server
|
||||||
+"\nMessage: "+message
|
+"\nMessage: "+message);
|
||||||
+"\n\t"+npe.getMessage());
|
npe.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static synchronized void setStream(String server, Socket socket) throws IOException{
|
public static synchronized void setStream(String server, Socket socket) throws IOException{
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class ConfigurationFile {
|
||||||
if (channelRules == null)
|
if (channelRules == null)
|
||||||
channelRules = new ArrayList<>();
|
channelRules = new ArrayList<>();
|
||||||
|
|
||||||
Ini.Section joinFloodControlSection = channelSection.getChild("rules");
|
Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl");
|
||||||
|
|
||||||
boolean joinFloodControl = joinFloodControlSection.get("enable", boolean.class);
|
boolean joinFloodControl = joinFloodControlSection.get("enable", boolean.class);
|
||||||
int joinFloodControlEventsNumber = -1;
|
int joinFloodControlEventsNumber = -1;
|
||||||
|
@ -114,7 +114,7 @@ public class ConfigurationFile {
|
||||||
joinFloodControlTimeFrame = joinFloodControlSection.get("time frame", int.class);
|
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);
|
boolean joinCloneControl = joinCloneControlSection.get("enable", boolean.class);
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class ConfigurationFileGenerator {
|
||||||
Ini.Section channelMainJoinCloneControlSection = channelMainSection.addChild("JoinCloneControl");
|
Ini.Section channelMainJoinCloneControlSection = channelMainSection.addChild("JoinCloneControl");
|
||||||
channelMainJoinCloneControlSection.put("enable", false);
|
channelMainJoinCloneControlSection.put("enable", false);
|
||||||
channelMainJoinCloneControlSection.put("pattern", "^.+[0-9]+?!.*$");
|
channelMainJoinCloneControlSection.put("pattern", "^.+[0-9]+?!.*$");
|
||||||
channelMainJoinFloodControlSection.put("time frame", 0);
|
channelMainJoinCloneControlSection.put("time frame", 0);
|
||||||
|
|
||||||
Ini.Section linksHeaderParser = channelMainSection.addChild("ParseLinksTitles");
|
Ini.Section linksHeaderParser = channelMainSection.addChild("ParseLinksTitles");
|
||||||
linksHeaderParser.put("enable", true);
|
linksHeaderParser.put("enable", true);
|
||||||
|
|
Loading…
Reference in a new issue