/* * ================================================================= * Filename: m_status.c * Description: Global Status Scanner (Kanalda olmayan userleri gosterir) * Author: Raistlin * Version: Unreal3.2 * ================================================================= */ #include "config.h" #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" #include "channel.h" #include #include #include #include "h.h" #ifndef MODVAR #define MODVAR #endif #define MSG_STATUS "STATUS" #define TOK_STATUS "ST" ModuleHeader MOD_HEADER(m_status) = { "status", "14.0", "Command: /status - Author: Raistlin - Global Status User Scanner (Lists users with no channels)", "3.2-b8-1", NULL }; extern void sendto_one(aClient *to, char *pattern, ...); extern void sendto_serv_butone(aClient *one, char *pattern, ...); DLLFUNC int m_status(aClient *cptr, aClient *sptr, int parc, char *parv[]); Command *CmdStatus; DLLFUNC int MOD_INIT(m_status)(ModuleInfo *modinfo) { CmdStatus = CommandAdd(modinfo->handle, MSG_STATUS, TOK_STATUS, m_status, 1, 0); return (CmdStatus ? MOD_SUCCESS : MOD_FAILED); } DLLFUNC int MOD_LOAD(m_status)(int module_load) { return MOD_SUCCESS; } DLLFUNC int MOD_UNLOAD(m_status)(int module_unload) { if (CmdStatus) CommandDel(CmdStatus); return MOD_SUCCESS; } DLLFUNC int m_status(aClient *cptr, aClient *sptr, int parc, char *parv[]) { aClient *acptr; int found_count = 0; if (!IsAnOper(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name); return 0; } if (MyConnect(sptr)) { sendto_serv_butone(cptr, ":%s %s", sptr->name, MSG_STATUS); } for (acptr = client; acptr; acptr = acptr->next) { if (!acptr || !IsPerson(acptr) || !MyConnect(acptr) || !acptr->user) continue; if (IsULine(acptr) || (acptr->umodes & UMODE_BOT)) continue; if (acptr->user->joined == 0) { found_count++; sendto_one(sptr, ":%s NOTICE %s :-Global- [Status-User] \002%s\002 (%s@%s) [%s]", me.name, sptr->name, acptr->name, acptr->user->username, acptr->user->realhost, me.name); } } if (found_count == 0 && MyConnect(sptr)) { sendto_one(sptr, ":%s NOTICE %s :-Global- Status scan complete.", me.name, sptr->name); } return 0; }