Bu Adreste Çok Sayıda TCL buldum. Senin istediğin TCL Altta Diğer Arşivlere Göz atmak istersen Adres
PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
/* contrib/m_opme.c
* Copyright (C) 2002 Hybrid Development Team
*
*/
#include "stdinc.h"
#include "tools.h"
#include "handlers.h"
#include "channel.h"
#include "channel_mode.h"
#include "client.h"
#include "ircd.h"
#include "numeric.h"
#include "s_log.h"
#include "s_serv.h"
#include "send.h"
#include "whowas.h"
#include "irc_string.h"
#include "hash.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
static void mo_opme(struct Client *client_p, struct Client *source_p, int parc, char *parv[]);
static int chan_is_opless(struct Channel *chptr);
struct Message opme_msgtab = {
"OPME", 0, 0, 2, 0, MFLG_SLOW, 0,
{m_unregistered, m_not_oper, m_ignore, mo_opme, m_ignore}
};
#ifndef STATIC_MODULES
void
_modinit(void)
{
mod_add_cmd(&opme_msgtab);
}
void
_moddeinit(void)
{
mod_del_cmd(&opme_msgtab);
}
const char *_version = "$Revision: 3.4 $";
#endif
static int
chan_is_opless(struct Channel *chptr)
{
dlink_node *ptr;
DLINK_FOREACH(ptr, chptr->members.head)
if (((struct Membership *)ptr->data)->flags & CHFL_CHANOP)
return(0);
return(1);
}
/*
** mo_opme
** parv[0] = sender prefix
** parv[1] = channel
*/
static void
mo_opme(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Channel *chptr;
struct Membership *member;
/* admins only */
if (!IsAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVILEGES),
me.name, source_p->name);
return;
}
/* XXX - we might not have CBURSTed this channel if we are a lazylink
* yet. */
if ((chptr = hash_find_channel(parv[1])) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL),
me.name, source_p->name, parv[1]);
return;
}
if ((member = find_channel_link(source_p, chptr)) == NULL)
{
sendto_one(source_p, form_str(ERR_NOTONCHANNEL),
me.name, source_p->name, parv[1]);
return;
}
if (chan_is_opless(chptr) == 0)
{
sendto_one(source_p, ":%s NOTICE %s :%s Channel is not opless",
me.name, source_p->name, parv[1]);
return;
}
AddMemberFlag(member, CHFL_CHANOP);
if (parv[1][0] == '&')
{
sendto_wallops_flags(UMODE_LOCOPS, &me,
"OPME called for [%s] by %s!%s@%s",
parv[1], source_p->name, source_p->username,
source_p->host);
}
else
{
sendto_wallops_flags(UMODE_WALLOP, &me,
"OPME called for [%s] by %s!%s@%s",
parv[1], source_p->name, source_p->username,
source_p->host);
sendto_server(NULL, NOCAPS, NOCAPS,
":%s WALLOPS :OPME called for [%s] by %s!%s@%s",
me.name, parv[1], source_p->name, source_p->username,
source_p->host);
}
ilog(L_NOTICE, "OPME called for [%s] by %s!%s@%s",
parv[1], source_p->name, source_p->username,
source_p->host);
sendto_server(NULL, CAP_TS6, NOCAPS,
":%s PART %s", ID(source_p), parv[1]);
sendto_server(NULL, NOCAPS, CAP_TS6,
":%s PART %s", source_p->name, parv[1]);
sendto_server(NULL, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :@%s",
me.id, (unsigned long)chptr->channelts,
parv[1], ID(source_p));
sendto_server(NULL, NOCAPS, CAP_TS6,
":%s SJOIN %ld %s + :@%s",
me.name, (unsigned long)chptr->channelts,
parv[1], source_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +o %s",
me.name, parv[1], source_p->name);
}