}\r
\r
public void logConnectEvent(String username, UserLogEntryType type, String ip) {\r
- logEvent("IP %s %sed to user '%s'.", ip, type.toString(), username);\r
+ logEvent("IP %s %sed %s user '%s'.", ip, type.toString(), type == UserLogEntryType.attach ? "to" : "from", username);\r
}\r
\r
private boolean logEvent(String event) {\r
}\r
\r
public static enum UserLogEntryType {\r
- Attach {\r
- @Override\r
- public String toString() {\r
- return "attach";\r
- }\r
- },\r
- Detach {\r
- @Override\r
- public String toString() {\r
- return "detach";\r
- }\r
- }\r
+ attach, detach\r
}\r
}\r
Pattern hostsStartParse = Pattern.compile("^:\\*status!.*@.* PRIVMSG .* :\\| Host *\\|");\r
Pattern hostsParse = Pattern.compile("^:\\*status!.*@.* PRIVMSG .* :\\| ([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}) \\|");\r
Pattern adminReply = Pattern.compile("^:\\*admin!.*@.* PRIVMSG .* :(.*)$");\r
- Pattern notifyConnectPattern = Pattern.compile("^:\\*status!.*@.* PRIVMSG .* :\\*{3} (.*) (attach|detach)ed \\((from|gone:) " +\r
- "([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}) \\)");\r
+ Pattern notifyConnectPattern = Pattern.compile("^:\\*status!.*@.* NOTICE [^:]* :\\*{3} (.*) (attach|detach)ed \\((from|gone:) " +\r
+ "([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\\)");\r
String line, words[];\r
while (BncBot.get().running && socket.isConnected() && !Thread.interrupted()) {\r
line = netIn.readLine();\r