+ unsigned int max_local;
+ unsigned int max_global;
+ unsigned int invisible;
+
+ LusersCounters()
+ : max_local(ServerInstance->Users->LocalUserCount())
+ , max_global(ServerInstance->Users->RegisteredUserCount())
+ , invisible(ServerInstance->Users->ModeCount('i'))
+ {
+ }
+
+ inline void UpdateMaxUsers()
+ {
+ unsigned int current = ServerInstance->Users->LocalUserCount();
+ if (current > max_local)
+ max_local = current;
+
+ current = ServerInstance->Users->RegisteredUserCount();
+ if (current > max_global)
+ max_global = current;
+ }
+};
+
+/** Handle /LUSERS. These command handlers can be reloaded by the core,
+ * and handle basic RFC1459 commands. Commands within modules work
+ * the same way, however, they can be fully unloaded, where these
+ * may not.
+ */
+class CommandLusers : public Command
+{
+ LusersCounters& counters;
+ public:
+ /** Constructor for lusers.
+ */
+ CommandLusers(Module* parent, LusersCounters& Counters)
+ : Command(parent,"LUSERS",0,0), counters(Counters)
+ { }
+ /** Handle command.
+ * @param parameters The parameters to the comamnd
+ * @param pcnt The number of parameters passed to teh command
+ * @param user The user issuing the command
+ * @return A value from CmdResult to indicate command success or failure.
+ */
+ CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+};