IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   Hazır_kodlar (https://www.ircforumlari.net/hazir_kodlar/)
-   -   Kanal/Ozel sureli mesaj yasaklama. (https://www.ircforumlari.net/hazir_kodlar/373814-kanal-ozel-sureli-mesaj-yasaklama.html)

No_FeaR 22 Kasım 2013 17:28

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
Ben Kurdum Fakat Unreal Kapandı .s

ExcLuSive 26 Ocak 2017 09:40

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
Port bazlı muaf tutabilirmiyiz ?

Alıntı:

toXic Nickli Üyeden Alıntı (Mesaj 1040629686)
İlk halindeki bilgiler;





süreyi buradan değişebilirsiniz. Kullanici giriş yaptiktan 60 saniye önce kanala veya özele text atarsa, Kullanicinin mesaji engellenip özeline ve statusune bilgi metni yollanir.
Kullanici bu süre çerçevesinde yazdiği takdirde, #Kontrol Kanalina alinir. Ayrica Bu süre çerçevesinde yazdiği mesajlar, #Botkontrol Kanalinda gösterilir.
Girişte 1 dk içerisinde yazilip engellenen tüm mesajlar, Kullanicinin IP Adresi ile birlikte tarihiyle log dosyasına kaydedilir.
Bununla birlikte, Sadece NET ADMINLER Bu log dosyasini, IRC Üzerinden komut yardimi ile okuyabilirler. Komut Kullanma sadece netadmindir.
Dosyayi irc üzerinden okumak icin, /knowledges komutunu kullaniniz.


Ve modulun suanki bilgileri;

Ozel ve Kanali tek modulde birleştirdim. Yani kanal ve özel icin tek bir modulde tek bir koruma olucak.
Bunlar disinda kanala veya özele yazilan yazilar belirlenen süre cercevesince engellenecek.
Birbaska olarakta, kullanici bu süre çerçevesi içerisinde /KALAN komutunu kullanarak mesaj yazmak icin ne kadar süresi kaldiğini öğrenebilecek..



Buraya o anlardaki yazilan yazilar loglanir. Log kanalidir isterseniz buradan değiştirebilirsiniz.



Buraya kendi sunucunuzun adini yaziniz.


Kod:

/*
*This module is Server Security module.
* The user, is connecting and, user can't write to channels notext minutes.
* You can change notext time.
* notext is seconds..
* And... if user write to channels in one minutes, The modul blocked users's messages one minute.
* User sjoin to #Kontrol.
* And, You are look to users messages in #BotKontrol channel..
* Use The /Knowledges Commands for forbid list.
* The messages are writing to yasaklilar.txt with User's IP, Date, clock, Nick and messages. They are logging..
*/
 
 
 
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.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
aChannel    *chptr;
 
#define tox "#BotKontrol"
#define SUNUCU "toXic.NET"
 
#define RPL_OPERS  337
 
#define MSG_knowledges "knowledges"
#define TOK_knowledges  "BL"
 
#define MSG_kalan "kalan"
#define TOK_kalan  "KL"
 
 
DLLFUNC char *m_notext(aClient *, aClient *, aClient *, char *, int);
DLLFUNC char *m_noptext(aClient *, aClient *, aClient *, char *, int);
 
DLLFUNC int m_knowledges(aClient *sptr);
DLLFUNC int m_kalan(aClient *sptr);
 
 
 
//seconds
  static int sure = 60;
 
#define modulismi "m_notext"
#define aciklama "Forbiddin text to channels/private 1 min. v3 (toXic)"
#define aciklama2 "Forbiddin text to channels/private 1 min. v3(toXic)"
#define version "3.2-b8-1"
ModuleHeader MOD_HEADER(m_notext)
= {
modulismi,
aciklama,
aciklama2,
version,
NULL
};
DLLFUNC int MOD_INIT(m_notext)(ModuleInfo *modinfo)
{
    HookAddPCharEx(modinfo->handle, HOOKTYPE_CHANMSG, m_notext);
    add_Command(MSG_knowledges, TOK_knowledges, m_knowledges, 1);
 add_Command(MSG_kalan, TOK_kalan, m_kalan, 1);
  HookAddPCharEx(modinfo->handle,  HOOKTYPE_USERMSG, m_noptext);
 
  return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_notext)(int module_load)
{
  return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_notext)(int module_unload)
{
  return MOD_SUCCESS;
}
DLLFUNC int m_knowledges(aClient *sptr)
{
if ( !IsNetAdmin(sptr)) {
 sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
        return 0;
        }
 
#define OKU "yasaklilar.txt"
int i;
FILE *dosya;
char buf[BUFSIZE];
dosya = fopen(OKU, "r");
if (dosya != NULL) {
while (fgets(buf, sizeof(buf), dosya)) {
buf[strlen(buf)-1] = 0;
//if ((chptr = find_channel(tox, NullChn)) != NullChn)
//sendto_channel_butone(&me, &me, chptr, ":%s PRIVMSG  %s %s  Kullanicisi, \2Yasaklilara\2 Bakti.", me.name, tox, sptr->name);
sendto_one(sptr, ":%s %d %s :%s", me.name, RPL_OPERS, sptr->name, buf);
}
}
}
 
 
 
 
DLLFUNC char *m_notext(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
 
if(!IsARegNick(sptr)  &&  !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr) && (sptr->firsttime + sure > TStime()))
{
 
 
if ((chptr = find_channel(tox, NullChn)) != NullChn)
{
 
sendto_channel_butone(&me, &me, chptr, ":Agent PRIVMSG %s  Nick-> \2%s\2  Message-> \2( %s )\2  remainder time -> \2%d\2..",
tox, sptr->name,  text, sure - (TStime() - sptr->firsttime));
}
 time_t irc_time;
                struct tm tdate;
                irc_time = time(NULL);
                tdate = *localtime(&irc_time);
                FILE * pFile;
                pFile = fopen ("yasaklilar.txt", "a");
                fprintf (pFile, "Tarih: %02d-%02d-%02d Saat: %02d:%02d Nick: %s  IP: %s  Text: %s\n", tdate.tm_mday, tdate.tm_mon + 1,
                tdate.tm_year - 100, tdate.tm_hour, tdate.tm_min, sptr->name,  sptr->user->realhost, text);
                fclose (pFile);
 
sendto_one(sptr, ":Uyari NOTICE %s :Kanalda,  \2Mesaj\2 Kullanabilmen icin \2%d\2 Saniye Daha Beklemelisiniz.",
 sptr->name,  sure - (TStime() - sptr->firsttime));
sendto_one(sptr, ":%s PRIVMSG %s :Kanala Mesaj atabilmeniz icin \2 bir sure \2  beklemelisiniz.. ", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Bundan muaf olmak istiyorsaniz, nickinizi \2/ns register sifre email\2 komutu ile  sifreleyiniz..", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Kalan surenize gormek icin, \2/Kalan\2 yaziniz.", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :\2 Hos Sohbetler..", SUNUCU, sptr->name);
 
char *kanal = "#Kontrol";
char *k[3], channels[512];
strlcpy(channels, kanal, sizeof(channels));
k[0] = sptr->name;
k[1]  = channels;
k[2] = NULL;
do_cmd(sptr, sptr, "JOIN", 2, k);
 
/* if you want to shun.
 
*******************************************************
* return place_host_ban(sptr, BAN_ACT_SHUN, "reason", 60);
*******************************************************
 
*/
 
return NULL;
}
 
  else
return text;
 
  }
 
 
DLLFUNC char *m_noptext(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
 
if(!IsARegNick(sptr)  &&  !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr) && (sptr->firsttime + sure > TStime()))
{
 
if ((chptr = find_channel(tox, NullChn)) != NullChn)
{
 
sendto_channel_butone(&me, &me, chptr, ":Agent PRIVMSG %s  Nick-> \2%s\2  Message-> \2( %s )\2  remainder time -> \2%d\2..",
tox, sptr->name,  text,  sure - (TStime() - sptr->firsttime));
}
 
sendto_one(sptr, ":Uyari NOTICE %s :Ozelde,  \2Mesaj\2 Kullanabilmen icin \2%d\2 Saniye Daha Beklemelisiniz.", sptr->name,  sure - (TStime() - sptr->firsttime));
sendto_one(sptr, ":%s PRIVMSG %s :Ozele Mesaj atabilmeniz icin \2 bir sure \2  beklemelisiniz.. ", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Bundan muaf olmak istiyorsaniz, nickinizi \2 /NS Register sifre email\2 komutu ile sifreleyiniz..", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Mesaj yazmak icin kac saniyeniz kaldigini gormek istiyorsaniz, \2/Kalan\2 yaziniz.", SUNUCU, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :\2 Hos Sohbetler..", SUNUCU, sptr->name);
 
char *kanal = "#Kontrol";
char *k[3], channels[512];
strlcpy(channels, kanal, sizeof(channels));
k[0] = sptr->name;
k[1]  = channels;
k[2] = NULL;
do_cmd(sptr, sptr, "JOIN", 2, k);
 
return NULL;
}
 
  else
return text;
 
  }
 
DLLFUNC int m_kalan(aClient *sptr) {
aClient *acptr;
if(!IsARegNick(sptr)  &&  !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr) && (sptr->firsttime + sure > TStime()))
{
 
sendto_one(sptr, ":Uyari PRIVMSG %s Kalan sureniz \2%d\2 saniyedir.", sptr->name,  sure - (TStime() - sptr->firsttime));
sendto_one(sptr, ":Uyari PRIVMSG %s Bu sureden sonra mesaj yazabileceksiniz.", sptr->name);
} else {
sendto_one(sptr, ":Uyari PRIVMSG %s Mesaj yazabilirsiniz.", sptr->name);
}
}



NonameX 05 Şubat 2018 22:19

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
Modülü kurup /kalan yazınca unreal kapanıyor varmı bir çözümü ?

Emrehan 05 Şubat 2018 23:54

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
Core oluşmuş mu?

GhostLy 01 Haziran 2024 17:18

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
eski bir konu /kalan yazınca unreal kapatıyor. denedim

GhostLy 01 Haziran 2024 20:33

Cevap: Kanal/Ozel sureli mesaj yasaklama.
 
/kalan komutunu kapattım unreal kapanmıyor.. tcl için #karantina kanalı ekledim bu şekilde hazır kod ve tcl'den yararlanabilirsiniz..

Kod:

/*
*This module is Server Security module.
* The user, is connecting and, user can't write to channels notext minutes.
* You can change notext time.
* notext is seconds..
* And... if user write to channels in one minutes, The modul blocked users's messages one minute.
* User sjoin to #Kontrol.
* And, You are look to users messages in #BotKontrol channel..
* Use The /Knowledges Commands for forbid list.
* The messages are writing to yasaklilar.txt with User's IP, Date, clock, Nick and messages. They are logging..
*/
 
 
 
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.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
aChannel    *chptr;
 
#define tox "#BotKontrol"
#define SUNUCU "Sanal.ORG"
 
#define RPL_OPERS  337
 
#define MSG_knowledges "knowledges"
#define TOK_knowledges  "BL"
 

 
 
DLLFUNC char *m_notext(aClient *, aClient *, aClient *, char *, int);
DLLFUNC char *m_noptext(aClient *, aClient *, aClient *, char *, int);
 
DLLFUNC int m_knowledges(aClient *sptr);

 
 
 
//seconds
  static int sure = 30;
 
#define modulismi "m_notext"
#define aciklama "Forbiddin text to channels/private 1 min. v3 (toXic)"
#define aciklama2 "Forbiddin text to channels/private 1 min. v3(toXic)"
#define version "3.2-b8-1"
ModuleHeader MOD_HEADER(m_notext)
= {
modulismi,
aciklama,
aciklama2,
version,
NULL
};
DLLFUNC int MOD_INIT(m_notext)(ModuleInfo *modinfo)
{
    HookAddPCharEx(modinfo->handle, HOOKTYPE_CHANMSG, m_notext);
    add_Command(MSG_knowledges, TOK_knowledges, m_knowledges, 1);
  HookAddPCharEx(modinfo->handle,  HOOKTYPE_USERMSG, m_noptext);
 
  return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_notext)(int module_load)
{
  return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_notext)(int module_unload)
{
  return MOD_SUCCESS;
}
DLLFUNC int m_knowledges(aClient *sptr)
{
if ( !IsNetAdmin(sptr)) {
 sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
        return 0;
        }
 
#define OKU "yasaklilar.txt"
int i;
FILE *dosya;
char buf[BUFSIZE];
dosya = fopen(OKU, "r");
if (dosya != NULL) {
while (fgets(buf, sizeof(buf), dosya)) {
buf[strlen(buf)-1] = 0;
//if ((chptr = find_channel(tox, NullChn)) != NullChn)
//sendto_channel_butone(&me, &me, chptr, ":%s PRIVMSG  %s %s  Kullanicisi, \2Yasaklilara\2 Bakti.", me.name, tox, sptr->name);
sendto_one(sptr, ":%s %d %s :%s", me.name, RPL_OPERS, sptr->name, buf);
}
}
}
 
 
 
 
DLLFUNC char *m_notext(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
 
if(!IsARegNick(sptr)  &&  !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr) && (sptr->firsttime + sure > TStime()))
{
 
 
if ((chptr = find_channel(tox, NullChn)) != NullChn)
{
 
sendto_channel_butone(&me, &me, chptr, ":Agent PRIVMSG %s  Nick-> \2%s\2  Message-> \2( %s )\2  remainder time -> \2%d\2..",
tox, sptr->name,  text, sure - (TStime() - sptr->firsttime));
}
 time_t irc_time;
                struct tm tdate;
                irc_time = time(NULL);
                tdate = *localtime(&irc_time);
                FILE * pFile;
                pFile = fopen ("yasaklilar.txt", "a");
                fprintf (pFile, "Tarih: %02d-%02d-%02d Saat: %02d:%02d Nick: %s  IP: %s  Text: %s\n", tdate.tm_mday, tdate.tm_mon + 1,
                tdate.tm_year - 100, tdate.tm_hour, tdate.tm_min, sptr->name,  sptr->user->realhost, text);
                fclose (pFile);
 
sendto_one(sptr, ":Uyari NOTICE %s :Kanala \2Mesaj\2 göndermek için \2%d\2 saniye daha beklemelisiniz.",
sptr->name,  sure - (TStime() - sptr->firsttime));
sendto_one(sptr, ":%s NOTICE %s :Bundan muaf olmak istiyorsaniz, nickinizi \2/ns register sifre email\2 komutu ile  sifreleyiniz..", SUNUCU, sptr->name);

char *kanal = "#Karantina";
char *k[3], channels[512];
strlcpy(channels, kanal, sizeof(channels));
k[0] = sptr->name;
k[1]  = channels;
k[2] = NULL;
do_cmd(sptr, sptr, "JOIN", 2, k);
 
/* if you want to shun.
 
*******************************************************
* return place_host_ban(sptr, BAN_ACT_SHUN, "reason", 60);
*******************************************************
 
*/
 
return NULL;
}
 
  else
return text;
 
  }
 
 
DLLFUNC char *m_noptext(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
 
if(!IsARegNick(sptr)  &&  !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr) && (sptr->firsttime + sure > TStime()))
{
 
if ((chptr = find_channel(tox, NullChn)) != NullChn)
{
 
sendto_channel_butone(&me, &me, chptr, ":Agent PRIVMSG %s  Nick-> \2%s\2  Message-> \2( %s )\2  remainder time -> \2%d\2..",
tox, sptr->name,  text,  sure - (TStime() - sptr->firsttime));
}
 
sendto_one(sptr, ":Uyari NOTICE %s :Ozelde,  \2Mesaj\2 Kullanabilmen icin \2%d\2 Saniye Daha Beklemelisiniz.", sptr->name,  sure - (TStime() - sptr->firsttime));
sendto_one(sptr, ":%s NOTICE %s  :Bundan muaf olmak istiyorsaniz, nickinizi \2 /NS Register sifre email\2 komutu ile sifreleyiniz..", SUNUCU, sptr->name);

 
char *kanal = "#Karantina";
char *k[3], channels[512];
strlcpy(channels, kanal, sizeof(channels));
k[0] = sptr->name;
k[1]  = channels;
k[2] = NULL;
do_cmd(sptr, sptr, "JOIN", 2, k);
 
return NULL;
}
 
  else
return text;
 
  }

sure.tcl olarak kullanılabilir
Kod:

set tor(kanal) "#Sohbet,#Radyo,#Oyun"
set tor(sure) "30"

bind raw * notice tor:connection
proc tor:connection {from keyword arg} {
  global tor
  if {[string match -nocase "*Client connecting on port*" $arg]} {
    set nick [lindex $arg 9]
    set port [string range [lindex [split [lindex $arg 8] ":"] 0] 0 end]
    set ident [string range [lindex [split [lindex $arg 10] "@"] 0] 1 end]
    set ip [string range [lindex [split [lindex $arg 10] "@"] 1] 0 end-1]
    if {![regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}} $ip]} {
    }
      putquick "operserv raw svsjoin $nick #Karantina"
          putquick "operserv raw svspart $nick $tor(kanal)"
    }
      utimer $tor(sure)[list putquick "sajoin $nick $tor(kanal)"]
    }



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 08:10.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk