Tekil Mesaj gösterimi
Alt 04 Aralık 2008, 19:37   #3
Çevrimdışı
uMut Doğrulanmış Üye
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: Farklı Kanalların kick mesajlarını sabitleme




--- NOT : içindeki irc.muhabbethatti.net i kendi serverınıza göre editleyiniz. ---

Evet arkadaşlar isteğim üzere ysfm bana çok yardımcı olmuştur gerekli editlemeleri yapmıştır bende içindeki gerekli kanal düzenlemelerini yaptım en azından aynen kullanabilirsiniz şimdi vereceğim m_kick.c yi.. gerekli en uygun düzenlemeler yapılıp yayınlanmıştır şimdi..

BUYRUN AŞAĞIDAKİ KODLARI AYNEN m_kick.c ye kopyalayınız.

PHP Kod:   Kodu kopyalamak için üzerine çift tıklayın!
/*
* IRC - Internet Relay Chat, src/modules/m_kick.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_kick(aClient *cptraClient *sptrint parcchar *parv[]);
#define MSG_KICK "KICK" 
#define TOK_KICK "H" 
ModuleHeader MOD_HEADER(m_kick)
= {
"m_kick",
"$Id: m_kick.c,v 1.1.6.5 2005/03/13 21:03:11 syzop Exp $",
"command /kick"
"3.2-b8-1",
NULL 
};
DLLFUNC int MOD_INIT(m_kick)(ModuleInfo *modinfo)
{
add_Command(MSG_KICKTOK_KICKm_kick3);
MARK_AS_OFFICIAL_MODULE(modinfo);
return 
MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_kick)(int module_load)
{
return 
MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_kick)(int module_unload)
{
if (
del_Command(MSG_KICKTOK_KICKm_kick) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_kick).name);
}
return 
MOD_SUCCESS;
}
/*
** m_kick
** parv[0] = sender prefix
** parv[1] = channel
** parv[2] = client to kick
** parv[3] = kick comment
*/
#ifdef PREFIX_AQ
#define CHFL_ISOP (CHFL_CHANOWNER|CHFL_CHANPROT|CHFL_CHANOP)
#else
#define CHFL_ISOP (CHFL_CHANOP)
#endif
CMD_FUNC(m_kick)
{
aClient *who;
aChannel *chptr;
int chasing 0;
char *comment, *name, *NULL, *user, *p2 NULL;
Membership *lp;
if (
parc || *parv[1] == '\0')
{
sendto_one(sptrerr_str(ERR_NEEDMOREPARAMS),
me.nameparv[0], "KICK");
return 
0;
}
comment = (BadPtr(parv[3])) ? parv[0] : parv[3];
if (
strlen(comment) > (size_t)TOPICLEN)
comment[TOPICLEN] = '\0';
for (; (
name strtoken(&pparv[1], ",")); parv[1] = NULL)
{
long sptr_flags 0;
chptr get_channel(sptrname, !CREATE);
if (!
chptr)
{
sendto_one(sptrerr_str(ERR_NOSUCHCHANNEL),
me.nameparv[0], name);
continue;
}
if (
check_channelmask(sptrcptrname))
continue;
/* Store "sptr" access flags */
if (IsPerson(sptr))
sptr_flags get_access(sptrchptr);
if (!
IsServer(cptr) && !IsULine(sptr) && !op_can_override(sptr)
&& !(
sptr_flags CHFL_ISOP) && !(sptr_flags CHFL_HALFOP))
{
sendto_one(sptrerr_str(ERR_CHANOPRIVSNEEDED),
me.nameparv[0], chptr->chname);
continue;
}
for (; (
user strtoken(&p2parv[2], ",")); parv[2] = NULL)
{
long who_flags;
if (!(
who find_chasing(sptruser, &chasing)))
continue; 
/* No such user left! */
if (!who->user)
continue;
if ((
lp find_membership_link(who->user->channelchptr)))
{
if (
IsULine(sptr) || IsServer(sptr))
goto 
attack;
/* Note for coders regarding oper override:
* always let a remote kick (=from a user on another server) trough or
* else we will get desynched. In short this means all the denying should
* always contain a && MyClient(sptr) [or sptr!=cptr] and at the end
* a remote kick should always be allowed (pass trough). -- Syzop
*/
/* applies to everyone (well except remote/ulines :p) */
if (IsKix(who) && !IsULine(sptr) && MyClient(sptr))
{
if (!
IsNetAdmin(sptr))
{
char errbuf[NICKLEN+10];
ircsprintf(errbuf"%s is +q"who->name);
sendto_one(sptrerr_str(ERR_CANNOTDOCOMMAND), 
me.namesptr->name"KICK"
errbuf);
sendto_one(who,
":%s %s %s :*** Q: %s tried to kick you from channel %s (%s)",
me.nameIsWebTV(who) ? "PRIVMSG" "NOTICE"who->name,
parv[0],
chptr->chnamecomment);
goto 
deny;
}
}
if (
chptr->mode.mode MODE_NOKICKS)
{
if (!
op_can_override(sptr))
{
sendto_one(sptrerr_str(ERR_CANNOTDOCOMMAND),
me.namesptr->name"KICK",
"channel is +Q");
goto 
deny;
}
sendto_snomask(SNO_EYES,
"*** OperOverride -- %s (%s@%s) KICK %s %s (%s)",
sptr->namesptr->user->usernamesptr->user->realhost,
chptr->chnamewho->namecomment);
goto 
attack/* No reason to continue.. */
}
/* Store "who" access flags */
who_flags get_access(whochptr);
/* we are neither +o nor +h, OR..
* we are +h but victim is +o, OR...
* we are +h and victim is +h
*/
if (op_can_override(sptr))
{
if ((!(
sptr_flags CHFL_ISOP) && !(sptr_flags CHFL_HALFOP)) ||
((
sptr_flags CHFL_HALFOP) && (who_flags CHFL_ISOP)) ||
((
sptr_flags CHFL_HALFOP) && (who_flags CHFL_HALFOP)))
{
sendto_snomask(SNO_EYES,
"*** OperOverride -- %s (%s@%s) KICK %s %s (%s)",
sptr->namesptr->user->usernamesptr->user->realhost,
chptr->chnamewho->namecomment);
/* Logging Implementation added by XeRXeS */
ircd_log(LOG_OVERRIDE,"OVERRIDE: %s (%s@%s) KICK %s %s (%s)",
sptr->namesptr->user->usernamesptr->user->realhost,
chptr->chnamewho->namecomment);
goto 
attack;
/* is_chan_op */

/* victim is +a or +q, we are not +q */
if ((who_flags & (CHFL_CHANOWNER|CHFL_CHANPROT) || IsServices(who))
&& !(
sptr_flags CHFL_CHANOWNER)) {
if (
op_can_override(sptr)) /* (and f*ck local ops) */
/* IRCop kicking owner/prot */
sendto_snomask(SNO_EYES,
"*** OperOverride -- %s (%s@%s) KICK %s %s (%s)",
sptr->namesptr->user->usernamesptr->user->realhost,
chptr->chnamewho->namecomment);
/* Logging Implementation added by XeRXeS */
ircd_log(LOG_OVERRIDE,"OVERRIDE: %s (%s@%s) KICK %s %s (%s)",
sptr->namesptr->user->usernamesptr->user->realhost
chptr->chnamewho->namecomment);
goto 
attack;
}
else if (!
IsULine(sptr) && (who != sptr) && MyClient(sptr))
{
char errbuf[NICKLEN+25];
if (
who_flags CHFL_CHANOWNER)
ircsprintf(errbuf"%s is a channel owner"
who->name);
else
ircsprintf(errbuf"%s is a channel admin"
who->name);
sendto_one(sptrerr_str(ERR_CANNOTDOCOMMAND),
me.namesptr->name"KICK",
errbuf);
goto 
deny;
continue;
/* chanprot/chanowner */
}
/* victim is +o, we are +h [operoverride is already taken care of 2 blocks above] */
if ((who_flags CHFL_ISOP) && (sptr_flags CHFL_HALFOP)
&& !(
sptr_flags CHFL_ISOP) && !IsULine(sptr) && MyClient(sptr))
{
char errbuf[NICKLEN+30];
ircsprintf(errbuf"%s is a channel operator"who->name);
sendto_one(sptrerr_str(ERR_CANNOTDOCOMMAND),
me.namesptr->name"KICK",
errbuf);
goto 
deny;
}
/* victim is +h, we are +h [operoverride is already taken care of 3 blocks above] */
if ((who_flags CHFL_HALFOP) && (sptr_flags CHFL_HALFOP)
&& !(
sptr_flags CHFL_ISOP) && MyClient(sptr))
{
char errbuf[NICKLEN+15];
ircsprintf(errbuf"%s is a halfop"who->name);
sendto_one(sptrerr_str(ERR_CANNOTDOCOMMAND),
me.namesptr->name"KICK",
errbuf);
goto 
deny;
/* halfop */
/* allowed (either coz access granted or a remote kick), so attack! */
goto attack;
deny:
continue;
attack:
if (
MyConnect(sptr)) {
int breakit 0;
Hook *h;
for (
Hooks[HOOKTYPE_PRE_LOCAL_KICK]; hh->next) {
if((*(
h->func.intfunc))(sptr,who,chptr,comment) > 0) {
breakit 1;
break;
}
}
if (
breakit)
continue;
RunHook5(HOOKTYPE_LOCAL_KICKcptr,sptr,who,chptr,comment);
} else {
RunHook5(HOOKTYPE_REMOTE_KICKcptrsptrwhochptrcomment);
}
if (
lp)
{
if ((
chptr->mode.mode MODE_AUDITORIUM) &&
!(
lp->flags & (CHFL_CHANOP|CHFL_CHANPROT|CHFL_CHANOWNER)))
{
/* Send it only to chanops & victim */
if (IsPerson(sptr))
sendto_chanops_butone(whochptr":%s!%s@%s KICK %s %s :%s",
sptr->namesptr->user->usernameGetHost(sptr),
chptr->chnamewho->namecomment);
else
sendto_chanops_butone(whochptr":%s KICK %s %s :%s",
sptr->namechptr->chnamewho->namecomment);
if (
MyClient(who))
sendto_prefix_one(whosptr":%s KICK %s %s :%s",
sptr->namechptr->chnamewho->namecomment);
}
else if ((!
stricmp(chptr->chname"#help")) || (!stricmp(chptr->chname"#operhelp")) ) {
sendto_channel_butserv(chptrsptr":%s KICK %s %s :1MuhabbetHatti.Net Resmi Yardım kanalindan Uygunsuz Davranislarinizdan Dolayi Atildiniz."parv[0], namewho->name); 
}
else if ((!
stricmp(chptr->chname"#DjSohbet")) || (!stricmp(chptr->chname"#helpers")) || (!stricmp(chptr->chname"#dj")) || (!stricmp(chptr->chname"#opers")) || (!stricmp(chptr->chname"#control")) || (!stricmp(chptr->chname"#log")) ) {
 
sendto_channel_butserv(chptrsptr":%s KICK %s %s :1Kanaldan Atildiniz."parv[0], namewho->name); 
}
else if ((!
stricmp(chptr->chname"#Radyo")) || (!stricmp(chptr->chname"#izmir")) || (!stricmp(chptr->chname"#Sohbet")) || (!stricmp(chptr->chname"#Zurna")) || (!stricmp(chptr->chname"#iStanbuL")) || (!stricmp(chptr->chname"#Muhabbet")) || (!stricmp(chptr->chname"#oyun")) || (!stricmp(chptr->chname"#Ankara")) || (!stricmp(chptr->chname"#yarisma")) || (!stricmp(chptr->chname"#kelime")) ) {
 
sendto_channel_butserv(chptrsptr":%s KICK %s %s :1Kanaldan Atildiniz, Baninizin hatali oldugunu dusunuyorsaniz \2%sHelp\2 kanalina giris yapiniz."parv[0], namewho->namechptr->chname);
}
else if (!(
stricmp(chptr->chname"#%shelp"))) {
sendto_channel_butserv(chptrsptr":%s KICK %s %s :1Gerekli Yardim Verilmistir. Hos Sohbetler Dileriz. irc.muhabbethatti.net"parv[0], namewho->name); 
 
} else {
sendto_channel_butserv(chptr,
sptr":%s KICK %s %s : 1Kanaldan Atildiniz, Baninizin hatali oldugunu dusunuyorsaniz \2#Şikayet\2 kanalina giris yapiniz."parv[0], namewho->name);
}
}
sendto_serv_butone_token(cptrparv[0],
MSG_KICKTOK_KICK"%s %s :%s",
namewho->namecomment);
if (
lp)
{
remove_user_from_channel(whochptr);
}
}
else if (
MyClient(sptr))
sendto_one(sptr,
err_str(ERR_USERNOTINCHANNEL),
me.nameparv[0], username);
if (
MyClient(cptr))
break;
/* loop on parv[2] */
if (MyClient(cptr))
break;
/* loop on parv[1] */
return 0;


TEKRAR DAN ysfm e teşekkür ederim.. burada m_kick.c de farklı tip kanalların kick mesajları daha ayrıntılı olarak belirtilmiştir.

--- NOT : içindeki irc.muhabbethatti.net i kendi serverınıza göre editleyiniz. ---


Konu uMut tarafından (04 Aralık 2008 Saat 19:44 ) değiştirilmiştir.
 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları sohbet bizimmekan