+ Implementation events[] = { I_OnPostConnect, I_OnUserQuit };
+ ServerInstance->Modules->Attach(events, this, sizeof(events)/sizeof(Implementation));
+ ServerInstance->Modes->AddModeWatcher(&mw);
+ }
+
+ void OnPostConnect(User* user)
+ {
+ counters.UpdateMaxUsers();
+ if (user->IsModeSet(invisiblemode))
+ counters.invisible++;
+ }
+
+ void OnUserQuit(User* user, const std::string& message, const std::string& oper_message)
+ {
+ if (user->IsModeSet(invisiblemode))
+ counters.invisible--;
+ }
+
+ ~ModuleLusers()
+ {
+ ServerInstance->Modes->DelModeWatcher(&mw);