private String hostname, abbr, nick, pass, gecos, ident;\r
private boolean ssl;\r
private int id, port;\r
+ private int userCount;\r
\r
private Timer lastSeenTimer;\r
private Thread connectionThread;\r
privmsg("*admin", String.format("LoadModule %s nickserv", user));\r
privmsg("*admin", String.format("LoadModule %s perform", user));\r
privmsg("*admin", String.format("LoadModule %s simple_away", user));\r
+ \r
+ this.userCount++;\r
}\r
\r
public void delUser(String user) {\r
privmsg("*admin", String.format("deluser %s", user));\r
+ this.userCount--;\r
}\r
\r
public void blockUser(String user, String reason) {\r
return (ArrayList<Pair<String, String>>) this.searchResults.clone();\r
}\r
}\r
+ \r
+ public int getUserCount() {\r
+ return this.userCount;\r
+ }\r
\r
public int[] getStats() {\r
synchronized(this.statsResults) {\r
\r
@Override\r
public String toString() {\r
- return String.format("(%s) %s:%s", this.abbr, this.hostname, this.port);\r
+ return String.format("(%s) %s:%s w/ %s users", this.abbr, this.hostname, this.port, this.userCount);\r
}\r
\r
private void privmsg(String target, String msg) {\r
}, 300000);\r
\r
stdPrintln("BNC connection established.");\r
+ \r
+ BncServer.this.privmsg("*status", "userstats");\r
\r
// TODO - Fix so that scan.nextLine() does not have to return for thread to exit.\r
netIn = new Scanner(socket.getInputStream());\r
BncServer.this.statsResults.put("totalusers", jo.getInt("totalusers"));\r
BncServer.this.statsResults.put("online", jo.getInt("online"));\r
BncServer.this.statsResults.put("totalconnected", jo.getInt("totalconnected"));\r
+ BncServer.this.userCount = jo.getInt("totalusers");\r
BncServer.this.statsResults.notifyAll();\r
}\r
}\r