PreparedStatement ps = null;
UserEntry ue = findUser(username);
+ if (ue == null) {
+ System.out.println("log connect event for unknown user " + username);
+ return;
+ }
+
try {
ps = conn.prepareStatement("INSERT INTO `bncbot_conn_log` (user_id, ip, event_type, was_last_client) VALUES (?, INET_ATON(?), ?, ?);");
boolean ident = bot.lookupIdentified(nick);
if(!ident) {
bot.privmsg(nick, bot.getString("genericErrorReason", bot.getString("userErrorIdentify")));
+ System.out.println(user + " no ident");
return;
}
String mainNick = bot.lookupNick(nick);
if(mainNick == null) {
bot.privmsg(nick, bot.getString("genericErrorReason", bot.getString("userErrorInfo")));
+ System.out.println(user + " no nick");
return;
}
Date regTime = bot.lookupRegTime(mainNick);
if(regTime == null) {
bot.privmsg(nick, bot.getString("genericErrorReason", bot.getString("userErrorInfo")));
+ System.out.println(user + " no regtime");
return;
}
String ip = connectMatcher.group(4);
boolean lastClient = connectMatcher.group(5) == null;
- BncBot.get().database.logConnectEvent(username, verb, ip, lastClient);
+ try {
+ BncBot.get().database.logConnectEvent(username, verb, ip, lastClient);
+ }
+ catch (Throwable ex) {
+ System.out.println("Error processing connect event for " + username + ": " + line);
+ ex.printStackTrace();
+ }
continue;
}