PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
/*
* IRC - Internet Relay Chat, src/modules/out.c
* (C) 2004 The UnrealIRCd Team
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_help(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_HELP "HELP"
#define TOK_HELP "4"
#define MSG_HELPOP "HELPOP"
ModuleHeader MOD_HEADER(m_help)
= {
"m_help",
"$Id: m_help.c,v 1.1.6.4 2005/03/13 21:03:10 syzop Exp $",
"command /help",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_help)(ModuleInfo *modinfo)
{
add_Command(MSG_HELP, TOK_HELP, m_help, 1);
add_Command(MSG_HELPOP, TOK_HELP, m_help, 1);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_help)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_help)(int module_unload)
{
if (del_Command(MSG_HELP, TOK_HELP, m_help) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_help).name);
}
if (del_Command(MSG_HELPOP, TOK_HELP, m_help) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_help).name);
}
return MOD_SUCCESS;
}
/*
** m_help (help/write to +h currently online) -Donwulff
** parv[0] = sender prefix
** parv[1] = optional message text
*/
CMD_FUNC(m_help)
{
char *message, *s;
Link *tmpl;
message = parc > 1 ? parv[1] : NULL;
/* Drags along from wallops code... I'm not sure what it's supposed to do,
at least it won't do that gracefully, whatever it is it does - but
checking whether or not it's a person _is_ good... -Donwulff */
if (!IsServer(sptr) && MyConnect(sptr) && !IsPerson(sptr))
{
}
if (IsServer(sptr) || IsHelpOp(sptr))
{
if (BadPtr(message)) {
if (MyClient(sptr)) {
parse_help(sptr, parv[0], NULL);
sendto_one(sptr,
":%s NOTICE %s :*** NOTE: As a helpop you have to prefix your text with ? to query the help system, like: /helpop ?usercmds",
me.name, sptr->name);
}
return 0;
}
if (message[0] == '?')
{
parse_help(sptr, parv[0], message + 1);
return 0;
}
if (!myncmp(message, "IGNORE ", 7))
{
tmpl = make_link();
DupString(tmpl->value.cp, message + 7);
tmpl->next = helpign;
helpign = tmpl;
return 0;
}
if (message[0] == '!')
message++;
if (BadPtr(message))
return 0;
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, "%s", message);
sendto_umode(UMODE_HELPOP, "*** HelpOp -- from %s (HelpOp): %s",
parv[0], message);
}
else if (MyConnect(sptr))
if %::chan == #helpstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Helpstaff_ $+ %::nick
sw $sockname os raw svsnick %::nick Helpstaff_ $+ %::nick :1
sw $sockname chghost %::nick Helpstaff.mIRCTRsohbet.neT
sw $sockname privmsg #helpstaff : %::nick Helpstaff Olarak sisteme girişiniz onaylandı.
}
}
if %::chan == #helpers && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Helper_ $+ %::nick
sw $sockname os raw svsnick %::nick Helper_ $+ %::nick :1
sw $sockname chghost %::nick Helper.mIRCTRsohbet.neT
sw $sockname privmsg #helpers : %::nick Helper Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #helpsop && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Helpsop_ $+ %::nick
sw $sockname os raw svsnick %::nick Helpsop_ $+ %::nick :1
sw $sockname chghost %::nick Helper.mIRCTRsohbet.neT
sw $sockname privmsg #Helpsop : %::nick Helpsop Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #Helpfounder && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Helpfounder_ $+ %::nick
sw $sockname os raw svsnick %::nick Helpfounder_ $+ %::nick :1
sw $sockname chghost %::nick Helper.mIRCTRsohbet.neT
sw $sockname privmsg #Helpfounder : %::nick Helpfounder Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #globalstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Globalstaff_ $+ %::nick
sw $sockname os raw svsnick %::nick Globalstaff_ $+ %::nick :1
sw $sockname chghost %::nick Globalstaff.mIRCTRsohbet.neT
sw $sockname privmsg #globalstaff : %::nick globalstaff Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #cinselstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Cinselstaff_ $+ %::nick
sw $sockname os raw svsnick %::nick Cinselstaff_ $+ %::nick :1
sw $sockname chghost %::nick Cinselstaff.mIRCTRsohbet.neT
sw $sockname privmsg #cinselstaff : %::nick Cinselstaff Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #Dj && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Dj_ $+ %::nick
sw $sockname os raw svsnick %::nick Dj_ $+ %::nick :1
sw $sockname chghost %::nick Dj.mIRCTRsohbet.neT
sw $sockname privmsg #Dj : %::nick Dj Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #localstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Localstaff_ $+ %::nick
sw $sockname os raw svsnick %::nick Localstaff_ $+ %::nick :1
sw $sockname chghost %::nick Localstaff.mIRCTRsohbet.neT
sw $sockname privmsg #Localdesk : %::nick Localstaff Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #helpstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nica5csa3c3x5xc23zxz5zx3ckk {
sw $sockname os raw svsnick %::nick Dj_ $+ %::nick :1
sw $sockname sethost %::nick Helpdesk.mIRCTRsohbet.neT
}
}
if %::chan == #sysop && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Sysop_ $+ %::nick
sw $sockname os raw svsnick %::nick Sysop_ $+ %::nick :1
sw $sockname chghost %::nick Global.Oper.mIRCTRsohbet.neT
sw $sockname privmsg #sysop : %::nick Sysop Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #Csop && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Csop_ $+ %::nick
sw $sockname os raw svsnick %::nick Csop_ $+ %::nick :1
sw $sockname chghost %::nick Co.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Csop : %::nick Csop Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #Admin && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Admin_ $+ %::nick
sw $sockname os raw svsnick %::nick Admin_ $+ %::nick :1
sw $sockname chghost %::nick Server.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Admin : %::nick Admin Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #Covisor && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Covisor_ $+ %::nick
sw $sockname os raw svsnick %::nick Covisor_ $+ %::nick :1
sw $sockname chghost %::nick Services.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Covisor : %::nick Covisor Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #Supervisor && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Supervisor_ $+ %::nick
sw $sockname os raw svsnick %::nick Supervisor_ $+ %::nick :1
sw $sockname chghost %::nick Network.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Supervisor : %::nick Supervisor Olarak sisteme girisiniz onaylandi.
}
}
if %::chan == #Techvisor && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Techvisor_ $+ %::nick
sw $sockname os raw svsnick %::nick Techvisor_ $+ %::nick :1
sw $sockname chghost %::nick Co.Root.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Master : %::nick Techvisor Olarak sisteme girişiniz onaylandı.
}
}
if %::chan == #Master && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Master_ $+ %::nick
sw $sockname os raw svsnick %::nick Master_ $+ %::nick :1
sw $sockname chghost %::nick Root.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Master : %::nick Master Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #Owner && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nick {
sw $sockname os raw swhois %::nick :Login ID : Owner_ $+ %::nick
sw $sockname os raw svsnick %::nick Owner_ $+ %::nick :1
sw $sockname chghost %::nick A1.Root.Administrator.mIRCTRsohbet.neT
sw $sockname privmsg #Master : %::nick Owner Olarak sisteme girisiniz onaylandı.
}
}
if %::chan == #helpstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nicsa5c3asc5x3c2g5vc2ckk {
sw $sockname os raw svsnick %::nick Helptaff_ $+ %::nick :1
sw $sockname sethost %::nick Helpstaff.mIRCTRsohbet.neT
}
}
if %::chan == #helpstaff && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !nifsv5sa6va63cxckk {
sw $sockname os raw svsnick %::nick Helpstaff_ $+ %::nick :1
sw $sockname sethost %::nick Helpstaff.mIRCTRsohbet.neT
}
}
if %::chan == #dj && $xisop(%::chan,%::nick) {
if $gettok(%::text,1,32) == !ni6cx6xc5cx2cx3g5xdf8sv5vs5vs5x6f5f2xc5xc56ck {
sw $sockname os raw2 svsnick %::nick Dj_ $+ %::nick :1
{
/* New syntax: ?... never goes out, !... always does. */
if (BadPtr(message)) {
parse_help(sptr, parv[0], NULL);
return 0;
}
else if (message[0] == '?') {
parse_help(sptr, parv[0], message+1);
return 0;
}
else if (message[0] == '!') {
message++;
}
else {
if (parse_help(sptr, parv[0], message))
return 0;
}
if (BadPtr(message))
return 0;
s = make_nick_user_host(cptr->name, cptr->user->username,
cptr->user->realhost);
for (tmpl = helpign; tmpl; tmpl = tmpl->next)
if (match(tmpl->value.cp, s) == 0)
{
sendto_one(sptr, rpl_str(RPL_HELPIGN), me.name,
parv[0]);
return 0;
}
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, "%s", message);
sendto_umode(UMODE_HELPOP, "*** HelpOp -- from %s (Local): %s",
parv[0], message);
sendto_one(sptr, rpl_str(RPL_HELPFWD), me.name, parv[0]);
}
else
{
if (BadPtr(message))
return 0;
sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL,
parv[0], MSG_HELP, TOK_HELP, "%s", message);
sendto_umode(UMODE_HELPOP, "*** HelpOp -- from %s: %s", parv[0],
message);
}
return 0;
}