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/)
-   Unreal IRCd (https://www.ircforumlari.net/unreal-ircd/)
-   -   Unreal3.2.3 moduller (https://www.ircforumlari.net/unreal-ircd/8853-unreal323-moduller.html)

ZORBEY 07 Aralık 2005 16:52

Unreal3.2.3 moduller
 
merhabalar Sizden ricam olucak bilgiğiniz ve elinizde var olan tüm modulleri koyabilirmsniz acaba lütfen bide make modul komutu neydi onuda unuttum yazarsanız sevinirim :)

Caistlin 07 Aralık 2005 16:56

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

make custommodule MODULEFILE=modulismi

srdraLc 07 Aralık 2005 17:04

Raistlin'e
 
Raistlin kardes yardimlarin icin tesekkür [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] bunu down ettim dedigin gibi oyle yazdiktan sonra restart attigimda aktif olacakmidir?

ZORBEY 07 Aralık 2005 17:16

olur ben aldım kurdum hepsini raistlin den yanlız abi bi sorunum var bilgi.c modulunu göremedim ayrıca onu kurarken conf a bi kaç şey ekliyormuşsun nasıl yapacağımı detaylı anlatabilirmsn?

Caistlin 07 Aralık 2005 17:19

bilgi.c ne icin, belki vardir bende baska isimle. icerigini ne ise yaradigini soyleyin yardimci olayim.

EkseLanS 07 Aralık 2005 19:18

Raistlin güzel paylasim +1
Bilgi.c ; Sunucuda Giris , cikis ve topic değişimlerini haber veren bi modul.. Ben vereyim link'ini..
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...][Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...][Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]
Kolay geLsin..

Caistlin 07 Aralık 2005 19:26

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

bilgi.c dediginiz bumuydu :) buda var bende rapor.c adinda. normal module gibi yukleyin ftp den Unreal3.2/src/modules
make custommodule MODULEFILE=rapor


unrealircd.conf icin gerekli satirlar.

Kod:

loadmodule "src/modules/rapor.so";
PHP- Kodu:

chansno
{
// msgtype privmsg;
channel "#Log" {
connectsserver-connectssquitsnickchanges;
kicksmode-changestopicsdisconnectsserver-connectspartsjoins;
};
}; 


rehash cektiginizde aktif olur #Log kanali icindir duzenleyebilirsiniz.

yanki 08 Aralık 2005 10:17

GüzeL Çalişma..

ZORBEY 09 Aralık 2005 16:51

sağolasın valla süpersin

ZORBEY 15 Mart 2006 16:38

ne gidi hata verdi?

devrimhoca 15 Nisan 2006 13:45

Yanıt: Unreal3.2.3 moduller
 
'CRYPTOLIB=' 'CRYPTOINCLUDES=' 'URL=' MODULEFILE=addwords 'EXLIBS=' custommodule
make[2]: Entering directory `/home/hossohbe/Unreal3.2/src/modules'
make[2]: *** No rule to make target `addwords.c', needed by `custommodule'. Stop.
make[2]: Leaving directory `/home/hossohbe/Unreal3.2/src/modules'
make[1]: *** [custommodule] Error 2
make[1]: Leaving directory `/home/hossohbe/Unreal3.2/src'
make: *** [custommodule] Error 2

Tilion 06 Haziran 2006 01:07

Yanıt: Unreal3.2.3 moduller
 
Acaba ozele yada kanala kullanılan
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
yada kufurleri otomatik olarak banlayan modul var mı varsa hangisi tesekkurler

Mesut1 18 Haziran 2006 01:17

Yanıt: Unreal3.2.3 moduller
 
ne hata verdi nede calıstı :)

Zippy 12 Temmuz 2006 14:48

Yanıt: Unreal3.2.3 moduller
 
adwords.c:2089: syntax error before "Membership"
adwords.c:2220:34: warning: multi-line string literals are deprecated
adwords.c:2223:34: warning: multi-line string literals are deprecated
adwords.c:2226:34: warning: multi-line string literals are deprecated
adwords.c:2230:34: warning: multi-line string literals are deprecated
adwords.c:2234:34: warning: multi-line string literals are deprecated
[akranx@localhost Unreal3.2]$ lti-line string literals are deprecated
adwords.c:2240:34: warning: multi-line string literals are deprecated
adwords.c:2296:25: warning: multi-line string literals are deprecated
adwords.c:237: storage size of `nickbuf' isn't known
make: *** [custommodule] Error 1

Nerden kaynaklanıyor bu hata?Bilen biri yardım edebilirmi?

z.a.L.i.m 23 Temmuz 2006 19:34

Yanıt: Unreal3.2.3 moduller
 
merhaba bana unreal 3.2.3 ün özel okuma modülü lazim yardim edermisiniz ?

CeNGaWeR 02 Ağustos 2006 18:34

Yanıt: Unreal3.2.3 moduller
 
bendede calışmadı :) hatada vermedi ama

Mickey 02 Ağustos 2006 19:30

Yanıt: Unreal3.2.3 moduller
 
unrealircd.conf 'a eklenmesi gerekenleri ekledinizmi?

KnOuCK 12 Mayıs 2009 20:45

Cevap: Yanıt: Unreal3.2.3 moduller
 
'CRYPTOLIB=' 'CRYPTOINCLUDES=' 'URL=' MODULEFILE=addwords 'EXLIBS=' custommodule
make[2]: Entering directory `/home/hossohbe/Unreal3.2/src/modules'
make[2]: *** No rule to make target `addwords.c', needed by `custommodule'. Stop.
make[2]: Leaving directory `/home/hossohbe/Unreal3.2/src/modules'
make[1]: *** [custommodule] Error 2
make[1]: Leaving directory `/home/hossohbe/Unreal3.2/src'
make: *** [custommodule] Error 2


aynı hatayı bende de verdi neden yapar sizce

GemLik 12 Mayıs 2009 20:50

Cevap: Unreal3.2.3 moduller
 
Kod:

make[2]: *** No rule to make target `addwords.c', needed by `custommodule'. Stop.
yalnış yazmışsın modulun ismini adwords olacak addwords yazmışın dikkat et

KnOuCK 12 Mayıs 2009 22:58

Cevap: Unreal3.2.3 moduller
 
make[2]: *** [custommodule] Error 1
make[2]: Leaving directory `/home/bilimcha/Unreal3.2/src/modules'
make[1]: *** [custommodule] Error 2
make[1]: Leaving directory `/home/bilimcha/Unreal3.2/src'
make: *** [custommodule] Error 2


gemlik li bu rapor.c yi yapcam ama böle hata veriyo bunu neden yapabilir sence yada komple atayım sana


Kod:

re 'strlcat'
../include/h.h:481: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strlncat'
../include/h.h:540: error: expected declaration specifiers or '...' before 'size_t'
../include/h.h:540: error: expected declaration specifiers or '...' before 'size_t'
../include/h.h:541: error: expected declaration specifiers or '...' before 'size_t'
../include/h.h:600: error: expected ')' before 'size'
rapor.c: In function 'test_chansno':
rapor.c:285: error: 'size_t' undeclared (first use in this function)
rapor.c:285: error: expected ';' before '__s1_len'
rapor.c:285: error: '__s1_len' undeclared (first use in this function)
rapor.c:285: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:285: error: '__s2_len' undeclared (first use in this function)
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:285: error: expected expression before 'const'
rapor.c:305: error: expected ';' before '__s1_len'
rapor.c:305: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:305: error: expected expression before 'const'
rapor.c:332: error: expected ';' before '__s1_len'
rapor.c:332: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:332: error: expected expression before 'const'
rapor.c:334: error: expected ';' before '__s1_len'
rapor.c:334: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:334: error: expected expression before 'const'
rapor.c:336: error: expected ';' before '__s1_len'
rapor.c:336: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c:336: error: expected expression before 'const'
rapor.c: In function 'conf_chansno':
rapor.c:369: error: 'size_t' undeclared (first use in this function)
rapor.c:369: error: expected ';' before '__s1_len'
rapor.c:369: error: '__s1_len' undeclared (first use in this function)
rapor.c:369: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:369: error: '__s2_len' undeclared (first use in this function)
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:369: error: expected expression before 'const'
rapor.c:373: error: expected ';' before '__s1_len'
rapor.c:373: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:373: error: expected expression before 'const'
rapor.c:375: warning: assignment makes pointer from integer without a cast
rapor.c:376: error: expected expression before 'const'
rapor.c:376: error: expected expression before 'const'
rapor.c:376: warning: incompatible implicit declaration of built-in function 'calloc'
rapor.c:376: error: expected ';' before '__len'
rapor.c:376: warning: incompatible implicit declaration of built-in function 'malloc'
rapor.c:376: error: '__len' undeclared (first use in this function)
rapor.c:376: error: too many arguments to function 'memcpy'
rapor.c:386: error: expected ';' before '__s1_len'
rapor.c:386: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:386: error: expected expression before 'const'
rapor.c:388: error: expected ';' before '__s1_len'
rapor.c:388: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:388: error: expected expression before 'const'
rapor.c:390: error: expected ';' before '__s1_len'
rapor.c:390: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c:390: error: expected expression before 'const'
rapor.c: In function 'get_flag_names':
rapor.c:409: error: too many arguments to function 'memset'
rapor.c:415: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c:422: warning: incompatible implicit declaration of built-in function 'strlen'
rapor.c: In function 'cb_mode':
rapor.c:559: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_connect':
rapor.c:575: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_quit':
rapor.c:586: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_join':
rapor.c:596: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_kick':
rapor.c:605: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_nickchange':
rapor.c:614: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_part':
rapor.c:624: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_server_connect':
rapor.c:649: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_server_quit':
rapor.c:663: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
rapor.c: In function 'cb_topic':
rapor.c:672: warning: passing argument 2 of 'snprintf' makes pointer from integer without a cast
make[2]: *** [custommodule] Error 1
make[2]: Leaving directory `/home/bilimcha/Unreal3.2/src/modules'
make[1]: *** [custommodule] Error 2
make[1]: Leaving directory `/home/bilimcha/Unreal3.2/src'
make: *** [custommodule] Error 2


GemLik 13 Mayıs 2009 02:49

Cevap: Unreal3.2.3 moduller
 
rapor.c dediğiniz bilgi modulu mu sunucuya giren cıkanlar yapılan mode ve topic değişkliği modulu işte
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] bunu kullanın

Jaqen 22 Aralık 2014 01:21

Cevap: Unreal3.2.3 moduller
 
bilgi.c / rapor.c
3.2.10.4 versiyonunda calismiyolar

modülü aktif hale getirdikten sonra sunucuya giris/cikis oldugunda ya da sunucuda kill/line gibi komutlar kullanildiginda sunucu kapaniyor.

elinde 3.2.10.4 uyumlu edit olan paylasirsa cok memnun olurum.
hub kurulu. bu tip bi modul olmadan ancak bagli oldugum linkdeki hareketleri görebiliyorum

tesekkürler

SeckiN 22 Aralık 2014 01:24

Cevap: Unreal3.2.3 moduller
 
Verdigim modulu ana sunucuya kurup denedin mi ustad.

Jaqen 22 Aralık 2014 01:30

Cevap: Unreal3.2.3 moduller
 
evet hocam
o da ayni
onunla birlikte digerlerinde de
türkce karakterleri falan düzenleyip, tekrar tekrar denedim


Alıntı:

SeckiN Nickli Üyeden Alıntı (Mesaj 1041575195)
Verdigim modulu ana sunucuya kurup denedin mi ustad.


BehroozWolf 22 Aralık 2014 02:45

Cevap: Unreal3.2.3 moduller
 
Alıntı:

Jaqen Nickli Üyeden Alıntı (Mesaj 1041575192)
bilgi.c / rapor.c
3.2.10.4 versiyonunda calismiyolar

modülü aktif hale getirdikten sonra sunucuya giris/cikis oldugunda ya da sunucuda kill/line gibi komutlar kullanildiginda sunucu kapaniyor.

elinde 3.2.10.4 uyumlu edit olan paylasirsa cok memnun olurum.
hub kurulu. bu tip bi modul olmadan ancak bagli oldugum linkdeki hareketleri görebiliyorum

tesekkürler


Kod:

/*
Written by AngryWolf

Edited(sytle) BehroozWolf

Conf ayarlari;

chansno
{
    // msgtype privmsg;

    channel "#Bilgi-1" {
        joins; parts; kicks; mode-changes; topics;
    };

    channel "#Bilgi-2" {
        nickchanges; connects; disconnects; server-connects; squits;
    };
};

*/
#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

typedef struct _conf_operflag OperFlag;
typedef struct _chansnoflag ChanSnoFlag;

struct _conf_operflag
{
        long                flag;
        char                *name;
};

struct _chansnoflag
{
        ChanSnoFlag        *prev, *next;
        char                *channel;
        long                flags;
};

extern ConfigEntry        *config_find_entry(ConfigEntry *, char *);
extern OperFlag                *config_binary_flags_search(OperFlag *table, char *cmd, int size);

#define MSG_CHANSNO        "CHANSNO"
#define TOK_CHANSNO        "CR"
#define MyMod                ModChanSno->handle
#define CHSNO_TABLESIZE        sizeof(_ChanSnoFlags)/sizeof(_ChanSnoFlags[0])
#define MaxSize                (sizeof(msgbuf) - strlen(msgbuf) - 1)

#define ircstrdup(x,y)  if (x) MyFree(x); if (!y) x = NULL; else x = strdup(y)
#define IsParam(x)        (parc > (x) && !BadPtr(parv[(x)]))
#define IsNotParam(x)        (parc <= (x) || BadPtr(parv[(x)]))
#define DelHook(x)        if (x) HookDel(x); x = NULL
#define DelCommand(x)        if (x) CommandDel(x); x = NULL

/* Messages types */

#define MT_PRIVMSG                0x00
#define MT_NOTICE                0x01
#define MsgType                        (msgtype == MT_PRIVMSG ? "PRIVMSG" : "NOTICE")

/* Channel server notice masks */

#define CHSNO_CONNECT                0x0001
#define CHSNO_DISCONNECT        0x0002
#define CHSNO_NICKCHANGE        0x0004
#define CHSNO_JOIN                0x0008
#define CHSNO_PART                0x0010
#define CHSNO_KICK                0x0020
#define CHSNO_CHANMODE                0x0040
#define CHSNO_SCONNECT                0x0080
#define CHSNO_SQUIT                0x0100
#define CHSNO_TOPIC                0x0200

/* This MUST be alphabetized */
OperFlag _ChanSnoFlags[] =
{
        { CHSNO_CONNECT,        "connects"                },
        { CHSNO_DISCONNECT,        "disconnects"                },
        { CHSNO_JOIN,                "joins"                        },
        { CHSNO_KICK,                "kicks"                        },
        { CHSNO_CHANMODE,        "mode-changes"                },
        { CHSNO_NICKCHANGE,        "nickchanges"                },
        { CHSNO_PART,                "parts"                        },
        { CHSNO_SCONNECT,        "server-connects"        },
        { CHSNO_SQUIT,                "squits"                },
        { CHSNO_TOPIC,                "topics"                }
};

static Command                *AddCommand(char *msg, char *token, int (*func)());
DLLFUNC int                m_chansno(aClient *cptr, aClient *sptr, int parc, char *parv[]);
DLLFUNC int                test_chansno(ConfigFile *, ConfigEntry *, int, int *);
DLLFUNC int                conf_chansno(ConfigFile *, ConfigEntry *, int);
DLLFUNC int                rehash_chansno();

DLLFUNC int                cb_mode(aClient *, aClient *, aChannel *, char *, char *, TS, int);
DLLFUNC int                cb_connect(aClient *);
DLLFUNC int                cb_quit(aClient *, char *);
DLLFUNC int                cb_join(aClient *, aClient *, aChannel *, char *[]);
DLLFUNC int                cb_kick(aClient *, aClient *, aClient *, aChannel *, char *);
DLLFUNC int                cb_nickchange(aClient *, char *);
DLLFUNC int                cb_part(aClient *, aClient *, aChannel *, char *);
DLLFUNC int                cb_server_connect(aClient *);
DLLFUNC int                cb_server_quit(aClient *);
DLLFUNC int                cb_topic();

ModuleInfo                *ModChanSno = NULL;
Command                        *CmdChanSno = NULL;
ChanSnoFlag                *ConfChanSno;
Hook                        *HookConfTest, *HookConfRun, *HookConfRehash;
Hook                        *HookMode, *HookConnect, *HookQuit, *HookJoin;
Hook                        *HookKick, *HookNickChange, *HookPart, *HookServerConnect;
Hook                        *HookServerQuit, *HookTopic;
static char                msgbuf[BUFSIZE+1];
u_int                        msgtype = MT_PRIVMSG;
static char                mybuf[BUFSIZE+1];

ModuleHeader MOD_HEADER(chansno)
  = {
        "Bilgilendirme",
        "v0.1",
        "AngryWolf",
        "3.2-b8-1",
        NULL
    };

static Command *AddCommand(char *msg, char *token, int (*func)())
{
        Command *cmd;

        if (CommandExists(msg))
            {
                config_error("%s komutu zaten kullaniliyor.", msg);
                return NULL;
            }
            if (CommandExists(token))
        {
                config_error("%s token'i(markasi) zaten kullaniliyor.", token);
                return NULL;
            }

        cmd = CommandAdd(MyMod, msg, token, func, MAXPARA, 0);

#ifndef _WIN32
        if (ModuleGetError(MyMod) != MODERR_NOERROR || !cmd)
#else
        if (!cmd)
#endif
        {
#ifndef _WIN32
                config_error("%s komutu eklenemedi: %s", msg,
                        ModuleGetErrorStr(MyMod));
#else
                config_error("%s komutu eklenemedi", msg);
#endif
                return NULL; /* just to be sure */
        }

        return cmd;
}

// =================================================================
// Functions related to loading/unloading configuration
// =================================================================

static void InitConf()
{
        ConfChanSno        = NULL;
        msgtype                = MT_PRIVMSG;
}

static void FreeConf()
{
        ChanSnoFlag        *c;
        ListStruct        *next;

        for (c = ConfChanSno; c; c = (ChanSnoFlag *) next)
        {
                next = (ListStruct *) c->next;
                DelListItem(c, ConfChanSno);
                MyFree(c->channel);
                MyFree(c);
        }
}

// =================================================================
// Module functions
// =================================================================

DLLFUNC int MOD_TEST(chansno)(ModuleInfo *modinfo)
{
        ModChanSno        = modinfo;
        HookConfTest        = HookAddEx(MyMod, HOOKTYPE_CONFIGTEST, test_chansno);

        return MOD_SUCCESS;
}

DLLFUNC int MOD_INIT(chansno)(ModuleInfo *modinfo)
{
        ModChanSno        = modinfo;

        InitConf();

        CmdChanSno        = AddCommand(MSG_CHANSNO, TOK_CHANSNO, m_chansno);
        HookConfRun        = HookAddEx(MyMod, HOOKTYPE_CONFIGRUN, conf_chansno);
        HookConfRehash        = HookAddEx(MyMod, HOOKTYPE_REHASH, rehash_chansno);

        if (!CmdChanSno)
                return MOD_FAILED;

        return MOD_SUCCESS;
}

DLLFUNC int MOD_LOAD(userauth)(int module_load)
{
        HookMode = HookAddEx(MyMod, HOOKTYPE_LOCAL_CHANMODE, cb_mode);
        HookConnect = HookAddEx(MyMod, HOOKTYPE_LOCAL_CONNECT, cb_connect);
        HookQuit = HookAddEx(MyMod, HOOKTYPE_LOCAL_QUIT, cb_quit);
        HookJoin = HookAddEx(MyMod, HOOKTYPE_LOCAL_JOIN, cb_join);
        HookKick = HookAddEx(MyMod, HOOKTYPE_LOCAL_KICK, cb_kick);
        HookNickChange = HookAddEx(MyMod, HOOKTYPE_LOCAL_NICKCHANGE, cb_nickchange);
        HookPart = HookAddEx(MyMod, HOOKTYPE_LOCAL_PART, cb_part);
        HookServerConnect = HookAddEx(MyMod, HOOKTYPE_SERVER_CONNECT, cb_server_connect);
        HookServerQuit = HookAddEx(MyMod, HOOKTYPE_SERVER_QUIT, cb_server_quit);
        HookTopic = HookAddEx(MyMod, HOOKTYPE_LOCAL_TOPIC, cb_topic);

        return MOD_SUCCESS;
}

DLLFUNC int MOD_UNLOAD(m_chansno)(int module_unload)
{
        DelHook(HookTopic);
        DelHook(HookServerQuit);
        DelHook(HookServerConnect);
        DelHook(HookPart);
        DelHook(HookNickChange);
        DelHook(HookKick);
        DelHook(HookJoin);
        DelHook(HookQuit);
        DelHook(HookConnect);
        DelHook(HookMode);

        DelHook(HookConfRehash);
        DelHook(HookConfRun);
        DelHook(HookConfTest);
        DelCommand(CmdChanSno);

        FreeConf();
        return MOD_SUCCESS;
}

// =================================================================
// Config file interfacing
// =================================================================

DLLFUNC int rehash_chansno()
{
        FreeConf();
        InitConf();

        return 1;
}

DLLFUNC int test_chansno(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
{
        ConfigEntry        *cep, *cepp;
        int                errors = 0;

        if (type != CONFIG_MAIN)
                return 0;

        if (!strcmp(ce->ce_varname, "chansno"))
        {
                for (cep = ce->ce_entries; cep; cep = cep->ce_next)
                {
                        if (!cep->ce_varname)
                        {
                                config_error("%s:%i: blank chansno item",
                                        cep->ce_fileptr->cf_filename,
                                        cep->ce_varlinenum);
                                errors++;
                                continue;
                        }
                        if (!cep->ce_vardata)
                        {
                                config_error("%s:%i: chansno::%s item without value",
                                        cep->ce_fileptr->cf_filename,
                                        cep->ce_varlinenum, cep->ce_varname);
                                errors++;
                                continue;
                        }
                        if (!strcmp(cep->ce_varname, "channel"))
                        {
                                if (!cep->ce_entries)
                                {
                                        config_error("%s:%i: chansno::channel without contents",
                                                cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
                                        errors++;
                                        continue;
                                }
                                for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
                                {
                                        if (!cepp->ce_varname)
                                        {
                                                config_error("%s:%i: chansno::channel item without variable name",
                                                        cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
                                                errors++;
                                                continue;
                                        }
                                        if (!config_binary_flags_search(_ChanSnoFlags, cepp->ce_varname, CHSNO_TABLESIZE))
                                        {
                                                config_error("%s:%i: unknown chansno::channel flag '%s'",
                                                        cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
                                                        cepp->ce_varname);
                                                errors++;
                                        }
                                }
                        }
                        else if (!strcmp(cep->ce_varname, "msgtype"))
                        {
                                if (!strcmp(cep->ce_vardata, "privmsg"))
                                        ;
                                else if (!strcmp(cep->ce_vardata, "notice"))
                                        ;
                                else
                                {
                                        config_error("%s:%i: unknown chansno::msgtype '%s'",
                                                cep->ce_fileptr->cf_filename, cep->ce_varlinenum,
                                                cep->ce_varname);
                                        errors++;
                                }
                        }
                        else
                        {
                                config_error("%s:%i: unknown directive chansno::%s",
                                        cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
                                errors++;
                        }
                }
                *errs = errors;
                return errors ? -1 : 1;
        }
        else
                return 0;
}

DLLFUNC int conf_chansno(ConfigFile *cf, ConfigEntry *ce, int type)
{
        ConfigEntry        *cep, *cepp;
        OperFlag        *ofp;
        ChanSnoFlag        *ca;

        if (type != CONFIG_MAIN)
                return 0;

        if (!strcmp(ce->ce_varname, "chansno"))
        {
                for (cep = ce->ce_entries; cep; cep = cep->ce_next)
                {
                        if (!strcmp(cep->ce_varname, "channel"))
                        {
                                ca = MyMallocEx(sizeof(ChanSnoFlag));
                                ircstrdup(ca->channel, cep->ce_vardata);

                                for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
                                {
                                        if ((ofp = config_binary_flags_search(_ChanSnoFlags, cepp->ce_varname, CHSNO_TABLESIZE)))
                                                ca->flags |= ofp->flag;
                                }

                                AddListItem(ca, ConfChanSno);
                        }
                        else if (!strcmp(cep->ce_varname, "msgtype"))
                        {
                                if (!strcmp(cep->ce_vardata, "privmsg"))
                                        msgtype = MT_PRIVMSG;
                                else if (!strcmp(cep->ce_vardata, "notice"))
                                        msgtype = MT_NOTICE;
                        }
                }

                return 1;
        }

        return 0;
}

// ===============================================================
// Functions used by m_chansno
// ===============================================================

static char *get_flag_names(long flags)
{
        u_int        i, found = 0;

        memset(&msgbuf, 0, sizeof msgbuf);

        for (i = 0; i < CHSNO_TABLESIZE; i++)
                if (flags & _ChanSnoFlags[i].flag)
                {
                        if (found)
                                strncat(msgbuf, ", ", MaxSize);
                        else
                                found = 1;

                        strncat(msgbuf, _ChanSnoFlags[i].name, MaxSize);
                }

        if (!strlen(msgbuf))
                strcpy(msgbuf, "<None>");

        return msgbuf;
}

static void stats_chansno_channels(aClient *sptr)
{
        ChanSnoFlag        *c;
       
        for (c = ConfChanSno; c; c = c->next)
                sendto_one(sptr,  "%s %i %s :Kanal %s: %s",
                        me.name, RPL_TEXT, sptr->name,
                        c->channel, get_flag_names(c->flags));

        sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'S');
}

static void stats_chansno_config(aClient *sptr)
{
        ChanSnoFlag        *c;
       
        sendto_one(sptr, ":%s %i %s :msgtype: %s",
                me.name, RPL_TEXT, sptr->name, MsgType);
        sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'S');
}

// ===============================================================
// m_chansno
//      parv[0]: sender prefix
//      parv[1]: option
//      parv[2]: server name (optional)
// ===============================================================

DLLFUNC int m_chansno(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
        if (!IsPerson(sptr))
                return -1;

        if (!IsAnOper(sptr))
        {
                sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
                return -1;
        }

        if (!IsParam(1))
        {
                sendto_one(sptr, ":%s NOTICE %s :Kullanimi:",
                        me.name, sptr->name);
                sendto_one(sptr, ":%s NOTICE %s :    /chansno <tercih> [<serveradi>]",
                        me.name, sptr->name);
                sendto_one(sptr, ":%s NOTICE %s :Ozellikleri:",
                        me.name, sptr->name);
                sendto_one(sptr, ":%s NOTICE %s :    list: displays the chansno::channel block list",
                        me.name, sptr->name);
                sendto_one(sptr, ":%s NOTICE %s :    config: shows the rest of chansno configuration",
                        me.name, sptr->name);
                return 0;
        }

        if (IsParam(2))
        {
                if (hunt_server_token(cptr, sptr, MSG_CHANSNO, TOK_CHANSNO,
                    "%s", 2, parc, parv) != HUNTED_ISME)
                        return 0;
        }

        if (!strcasecmp(parv[1], "list"))
                stats_chansno_channels(sptr);
        else if (!strcasecmp(parv[1], "config"))
                stats_chansno_config(sptr);
        else
        {
                sendto_one(sptr, ":%s NOTICE %s :Hatali option %s."
                        " Valid options are: list | config",
                        me.name, sptr->name, parv[1]);
                return -1;
        }

        return 0;
}

// ===============================================================
// Interface for sending notifications
// ===============================================================

#define SendBuf_simple \
        if ((sendto = find_channel(c->channel, NullChn)) != NullChn) \
                sendto_channel_butone(&me, &me, sendto, ":%s %s %s :%s", \
                        me.name, MsgType, sendto->chname, msgbuf)

#define SendBuf_channel \
        if (!find_sno_channel(chptr) && (sendto = find_channel(c->channel, NullChn)) != NullChn) \
                sendto_channel_butone(&me, &me, sendto, ":%s %s %s :%s", \
                        me.name, MsgType, sendto->chname, msgbuf)

static u_int find_sno_channel(aChannel *chptr)
{
        ChanSnoFlag        *c;
       
        for (c = ConfChanSno; c; c = c->next)
                if (!strcasecmp(chptr->chname, c->channel))
                        return 1;

        return 0;
}

static void SendNotice_simple(long type)
{
        ChanSnoFlag        *c;
        aChannel        *sendto;

        for (c = ConfChanSno; c; c = c->next)
        {
                if (c->flags & type)
                        SendBuf_simple;
        }
}

static void SendNotice_channel(aChannel *chptr, long type)
{
        ChanSnoFlag        *c;
        aChannel        *sendto;

        for (c = ConfChanSno; c; c = c->next)
        {
                if (c->flags & type)
                        SendBuf_channel;
        }
}

static char *FullDate(TS time_in)
        {
        struct tm *tp = localtime(&time_in);

        if (!tp)
                return NULL;

        memset(&mybuf, 0, sizeof mybuf);
        strftime(mybuf, sizeof mybuf, "%d-%m-%Y - %H:%M:%S", tp);
                //strftime(mybuf, sizeof mybuf, "%B %x %A %X", tp);

        return mybuf;
        }

DLLFUNC int cb_mode(aClient *cptr, aClient *sptr, aChannel *chptr,
  char *modebuf, char *parabuf, TS sendts, int samode)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) rumuzu (%s) kanalina mod ayarini degistirerek (%s%s%s) yapti",
                FullDate(sptr->lasttime), sptr->name, chptr->chname, modebuf,
                BadPtr(parabuf) ? "" : " ",
                BadPtr(parabuf) ? "" : parabuf);

        SendNotice_channel(chptr, CHSNO_CHANMODE);
        return 0;
}

DLLFUNC int cb_connect(aClient *sptr)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s@%s) rumuzu (%d) portu üzerinden sunucuya baglanti kurdu. [%s] %s%s%s",
                FullDate(sptr->lasttime), sptr->name, sptr->user->username, sptr->user->realhost, sptr->listener->port,
                    sptr->class ? sptr->class->name : "",
#ifdef USE_SSL
                IsSecure(sptr) ? "[secure " : "",
                IsSecure(sptr) ? SSL_get_cipher((SSL *)sptr->ssl) : "",
                IsSecure(sptr) ? "]" : "");
#else
                "", "", "");
#endif

        SendNotice_simple(CHSNO_CONNECT);
        return 0;
}

DLLFUNC int cb_quit(aClient *sptr, char *comment)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s@%s) rumuzu sunucudan ayrildi. (%s)",
                FullDate(sptr->lasttime), sptr->name, sptr->user->username,
                sptr->user->realhost, comment);

        SendNotice_simple(CHSNO_DISCONNECT);
        return 0;
}

DLLFUNC int cb_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *parv[])
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s@%s) rumuzu (%s) kanalina giris yapti",
                FullDate(sptr->lasttime), sptr->name, sptr->user->username, sptr->user->realhost,
                chptr->chname);

        SendNotice_channel(chptr, CHSNO_JOIN);
        return 0;
}

DLLFUNC int cb_kick(aClient *cptr, aClient *sptr, aClient *who, aChannel *chptr, char *comment)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) kanal operatoru (%s) (%s) rumuzunu kanaldan uzaklastirdi (%s)",
                FullDate(sptr->lasttime), chptr->chname, sptr->name, who->name, comment);

        SendNotice_channel(chptr, CHSNO_KICK);
        return 0;
}

DLLFUNC int cb_nickchange(aClient *sptr, char *nick)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s@%s) rumuzu nick degistirdi ve (%s) oldu",
                FullDate(sptr->lasttime), sptr->name, sptr->user->username, sptr->user->realhost, nick);

        SendNotice_simple(CHSNO_NICKCHANGE);
        return 0;
}

DLLFUNC int cb_part(aClient *cptr, aClient *sptr, aChannel *chptr, char *comment)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s@%s) rumuzu (%s) kanalindan cikis yapti (%s)",
                FullDate(sptr->lasttime), sptr->name, sptr->user->username, sptr->user->realhost,
                chptr->chname, comment ? comment : sptr->name);

        SendNotice_channel(chptr, CHSNO_PART);
        return 0;
}

DLLFUNC int cb_server_connect(aClient *sptr)
{
        if (!MyConnect(sptr))
                return 0;

        snprintf(msgbuf, BUFSIZE, "[%s] (%s) (%s) rumuzu (%d) portu üzerinden sunucuya baglanti kurdu. [%s] %s%s%s%s",
                FullDate(sptr->lasttime), sptr->name, sptr->info, sptr->listener->port,
                    sptr->class ? sptr->class->name : "",
#ifdef USE_SSL
                IsSecure(sptr) ? "[secure " : "",
                IsSecure(sptr) ? SSL_get_cipher((SSL *)sptr->ssl) : "",
                IsSecure(sptr) ? "]" : "",
#else
                "", "", "",
#endif

#ifdef ZIP_LINKS
                IsZipped(sptr) ? " [zip]" : "");
#else
                "");
#endif

        SendNotice_simple(CHSNO_SCONNECT);
        return 0;
}

DLLFUNC int cb_server_quit(aClient *sptr)
{
        if (!MyConnect(sptr))
                return 0;

        /* The hook supports no reason :-( */
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) rumuzu sunucudan ayrildi.",
                FullDate(sptr->lasttime), sptr->name);

        SendNotice_simple(CHSNO_SQUIT);
        return 0;
}

DLLFUNC int cb_topic(aClient *cptr, aClient *sptr, aChannel *chptr, char *topic)
{
        snprintf(msgbuf, BUFSIZE, "[%s] (%s) kanalinin giris metni(topik) (%s) tarafindan degistirilerek (%s) yapildi",
                FullDate(sptr->lasttime), chptr->chname, sptr->name, topic);

        SendNotice_channel(chptr, CHSNO_SQUIT);
        return 0;
}


Jaqen 22 Aralık 2014 12:27

Cevap: Unreal3.2.3 moduller
 
bu oldu hocam

az degisiklik yapma imkanimiz var mi ?
msg basinda tarih saat bilgisi var. ona gerek yok bence, onu silsek

sonra
renklendirsek az
mesela client girislerini yesil
client cikislarini lacivert yapsak

nick degisimlerini eflatun göstersek
var mi bu imkanimiz ?

No_FeaR 22 Aralık 2014 22:57

Cevap: Unreal3.2.3 moduller
 
Alıntı:

Jaqen Nickli Üyeden Alıntı (Mesaj 1041575344)
bu oldu hocam

az degisiklik yapma imkanimiz var mi ?
msg basinda tarih saat bilgisi var. ona gerek yok bence, onu silsek

sonra
renklendirsek az
mesela client girislerini yesil
client cikislarini lacivert yapsak

nick degisimlerini eflatun göstersek
var mi bu imkanimiz ?

Satır Kaydırmamaya Dikkat Et. Ek Olarakta Ne Olur Ne Olmaz Diye de Yedeğini Al, Olur ki bi Sıkıntı Olursa Yedekten Devam Edersin.

Jaqen 22 Aralık 2014 23:33

Cevap: Unreal3.2.3 moduller
 
denedim ama bozuluyo

Alıntı:

No_FeaR Nickli Üyeden Alıntı (Mesaj 1041575913)
Satır Kaydırmamaya Dikkat Et. Ek Olarakta Ne Olur Ne Olmaz Diye de Yedeğini Al, Olur ki bi Sıkıntı Olursa Yedekten Devam Edersin.


No_FeaR 23 Aralık 2014 19:50

Cevap: Unreal3.2.3 moduller
 
Alıntı:

Jaqen Nickli Üyeden Alıntı (Mesaj 1041575945)
denedim ama bozuluyo



Olduğu Gibi Kullanmayı Dene O Halde... : )

Entrance 26 Aralık 2014 20:36

Cevap: Unreal3.2.3 moduller
 
Kod:

/*
Written by AngryWolf

Edited(sytle) BehroozWolf

Conf ayarlari;

chansno
{
    // msgtype privmsg;

    channel "#Bilgi-1" {
        joins; parts; kicks; mode-changes; topics;
    };

    channel "#Bilgi-2" {
        nickchanges; connects; disconnects; server-connects; squits;
    };
};

*/
#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

typedef struct _conf_operflag OperFlag;
typedef struct _chansnoflag ChanSnoFlag;

struct _conf_operflag
{
    long        flag;
    char        *name;
};

struct _chansnoflag
{
    ChanSnoFlag    *prev, *next;
    char        *channel;
    long        flags;
};

extern ConfigEntry    *config_find_entry(ConfigEntry *, char *);
extern OperFlag        *config_binary_flags_search(OperFlag *table, char *cmd, int size);

#define MSG_CHANSNO    "CHANSNO"
#define TOK_CHANSNO    "CR"
#define MyMod        ModChanSno->handle
#define CHSNO_TABLESIZE    sizeof(_ChanSnoFlags)/sizeof(_ChanSnoFlags[0])
#define MaxSize        (sizeof(msgbuf) - strlen(msgbuf) - 1)

#define ircstrdup(x,y)  if (x) MyFree(x); if (!y) x = NULL; else x = strdup(y)
#define IsParam(x)    (parc > (x) && !BadPtr(parv[(x)]))
#define IsNotParam(x)    (parc <= (x) || BadPtr(parv[(x)]))
#define DelHook(x)    if (x) HookDel(x); x = NULL
#define DelCommand(x)    if (x) CommandDel(x); x = NULL

/* Messages types */

#define MT_PRIVMSG        0x00
#define MT_NOTICE        0x01
#define MsgType            (msgtype == MT_PRIVMSG ? "PRIVMSG" : "NOTICE")

/* Channel server notice masks */

#define CHSNO_CONNECT        0x0001
#define CHSNO_DISCONNECT    0x0002
#define CHSNO_NICKCHANGE    0x0004
#define CHSNO_JOIN        0x0008
#define CHSNO_PART        0x0010
#define CHSNO_KICK        0x0020
#define CHSNO_CHANMODE        0x0040
#define CHSNO_SCONNECT        0x0080
#define CHSNO_SQUIT        0x0100
#define CHSNO_TOPIC        0x0200

/* This MUST be alphabetized */
OperFlag _ChanSnoFlags[] =
{
    { CHSNO_CONNECT,    "connects"        },
    { CHSNO_DISCONNECT,    "disconnects"        },
    { CHSNO_JOIN,        "joins"            },
    { CHSNO_KICK,        "kicks"            },
    { CHSNO_CHANMODE,    "mode-changes"        },
    { CHSNO_NICKCHANGE,    "nickchanges"        },
    { CHSNO_PART,        "parts"            },
    { CHSNO_SCONNECT,    "server-connects"    },
    { CHSNO_SQUIT,        "squits"        },
    { CHSNO_TOPIC,        "topics"        }
};

static Command        *AddCommand(char *msg, char *token, int (*func)());
DLLFUNC int        m_chansno(aClient *cptr, aClient *sptr, int parc, char *parv[]);
DLLFUNC int        test_chansno(ConfigFile *, ConfigEntry *, int, int *);
DLLFUNC int        conf_chansno(ConfigFile *, ConfigEntry *, int);
DLLFUNC int        rehash_chansno();

DLLFUNC int        cb_mode(aClient *, aClient *, aChannel *, char *, char *, TS, int);
DLLFUNC int        cb_connect(aClient *);
DLLFUNC int        cb_quit(aClient *, char *);
DLLFUNC int        cb_join(aClient *, aClient *, aChannel *, char *[]);
DLLFUNC int        cb_kick(aClient *, aClient *, aClient *, aChannel *, char *);
DLLFUNC int        cb_nickchange(aClient *, char *);
DLLFUNC int        cb_part(aClient *, aClient *, aChannel *, char *);
DLLFUNC int        cb_server_connect(aClient *);
DLLFUNC int        cb_server_quit(aClient *);
DLLFUNC int        cb_topic();

ModuleInfo        *ModChanSno = NULL;
Command            *CmdChanSno = NULL;
ChanSnoFlag        *ConfChanSno;
Hook            *HookConfTest, *HookConfRun, *HookConfRehash;
Hook            *HookMode, *HookConnect, *HookQuit, *HookJoin;
Hook            *HookKick, *HookNickChange, *HookPart, *HookServerConnect;
Hook            *HookServerQuit, *HookTopic;
static char        msgbuf[BUFSIZE+1];
u_int            msgtype = MT_PRIVMSG;
static char        mybuf[BUFSIZE+1];

ModuleHeader MOD_HEADER(chansno)
  = {
    "Bilgilendirme",
    "v0.1",
    "AngryWolf",
    "3.2-b8-1",
    NULL
    };

static Command *AddCommand(char *msg, char *token, int (*func)())
{
    Command *cmd;

    if (CommandExists(msg))
        {
        config_error("%s komutu zaten kullaniliyor.", msg);
        return NULL;
        }
        if (CommandExists(token))
    {
        config_error("%s token'i(markasi) zaten kullaniliyor.", token);
        return NULL;
        }

    cmd = CommandAdd(MyMod, msg, token, func, MAXPARA, 0);

#ifndef _WIN32
    if (ModuleGetError(MyMod) != MODERR_NOERROR || !cmd)
#else
    if (!cmd)
#endif
    {
#ifndef _WIN32
        config_error("%s komutu eklenemedi: %s", msg,
            ModuleGetErrorStr(MyMod));
#else
        config_error("%s komutu eklenemedi", msg);
#endif
        return NULL; /* just to be sure */
    }

    return cmd;
}

// =================================================================
// Functions related to loading/unloading configuration
// =================================================================

static void InitConf()
{
    ConfChanSno    = NULL;
    msgtype        = MT_PRIVMSG;
}

static void FreeConf()
{
    ChanSnoFlag    *c;
    ListStruct    *next;

    for (c = ConfChanSno; c; c = (ChanSnoFlag *) next)
    {
        next = (ListStruct *) c->next;
        DelListItem(c, ConfChanSno);
        MyFree(c->channel);
        MyFree(c);
    }
}

// =================================================================
// Module functions
// =================================================================

DLLFUNC int MOD_TEST(chansno)(ModuleInfo *modinfo)
{
    ModChanSno    = modinfo;
    HookConfTest    = HookAddEx(MyMod, HOOKTYPE_CONFIGTEST, test_chansno);

    return MOD_SUCCESS;
}

DLLFUNC int MOD_INIT(chansno)(ModuleInfo *modinfo)
{
    ModChanSno    = modinfo;

    InitConf();

    CmdChanSno    = AddCommand(MSG_CHANSNO, TOK_CHANSNO, m_chansno);
    HookConfRun    = HookAddEx(MyMod, HOOKTYPE_CONFIGRUN, conf_chansno);
    HookConfRehash    = HookAddEx(MyMod, HOOKTYPE_REHASH, rehash_chansno);

    if (!CmdChanSno)
        return MOD_FAILED;

    return MOD_SUCCESS;
}

DLLFUNC int MOD_LOAD(userauth)(int module_load)
{
    HookMode = HookAddEx(MyMod, HOOKTYPE_LOCAL_CHANMODE, cb_mode);
    HookConnect = HookAddEx(MyMod, HOOKTYPE_LOCAL_CONNECT, cb_connect);
    HookQuit = HookAddEx(MyMod, HOOKTYPE_LOCAL_QUIT, cb_quit);
    HookJoin = HookAddEx(MyMod, HOOKTYPE_LOCAL_JOIN, cb_join);
    HookKick = HookAddEx(MyMod, HOOKTYPE_LOCAL_KICK, cb_kick);
    HookNickChange = HookAddEx(MyMod, HOOKTYPE_LOCAL_NICKCHANGE, cb_nickchange);
    HookPart = HookAddEx(MyMod, HOOKTYPE_LOCAL_PART, cb_part);
    HookServerConnect = HookAddEx(MyMod, HOOKTYPE_SERVER_CONNECT, cb_server_connect);
    HookServerQuit = HookAddEx(MyMod, HOOKTYPE_SERVER_QUIT, cb_server_quit);
    HookTopic = HookAddEx(MyMod, HOOKTYPE_LOCAL_TOPIC, cb_topic);

    return MOD_SUCCESS;
}

DLLFUNC int MOD_UNLOAD(m_chansno)(int module_unload)
{
    DelHook(HookTopic);
    DelHook(HookServerQuit);
    DelHook(HookServerConnect);
    DelHook(HookPart);
    DelHook(HookNickChange);
    DelHook(HookKick);
    DelHook(HookJoin);
    DelHook(HookQuit);
    DelHook(HookConnect);
    DelHook(HookMode);

    DelHook(HookConfRehash);
    DelHook(HookConfRun);
    DelHook(HookConfTest);
    DelCommand(CmdChanSno);

    FreeConf();
    return MOD_SUCCESS;
}

// =================================================================
// Config file interfacing
// =================================================================

DLLFUNC int rehash_chansno()
{
    FreeConf();
    InitConf();

    return 1;
}

DLLFUNC int test_chansno(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
{
    ConfigEntry    *cep, *cepp;
    int        errors = 0;

    if (type != CONFIG_MAIN)
        return 0;

    if (!strcmp(ce->ce_varname, "chansno"))
    {
        for (cep = ce->ce_entries; cep; cep = cep->ce_next)
        {
            if (!cep->ce_varname)
            {
                config_error("%s:%i: blank chansno item",
                    cep->ce_fileptr->cf_filename,
                    cep->ce_varlinenum);
                errors++;
                continue;
            }
            if (!cep->ce_vardata)
            {
                config_error("%s:%i: chansno::%s item without value",
                    cep->ce_fileptr->cf_filename,
                    cep->ce_varlinenum, cep->ce_varname);
                errors++;
                continue;
            }
            if (!strcmp(cep->ce_varname, "channel"))
            {
                if (!cep->ce_entries)
                {
                    config_error("%s:%i: chansno::channel without contents",
                        cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
                    errors++;
                    continue;
                }
                for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
                {
                    if (!cepp->ce_varname)
                    {
                        config_error("%s:%i: chansno::channel item without variable name",
                            cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
                        errors++;
                        continue;
                    }
                    if (!config_binary_flags_search(_ChanSnoFlags, cepp->ce_varname, CHSNO_TABLESIZE))
                    {
                        config_error("%s:%i: unknown chansno::channel flag '%s'",
                            cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
                            cepp->ce_varname);
                        errors++;
                    }
                }
            }
            else if (!strcmp(cep->ce_varname, "msgtype"))
            {
                if (!strcmp(cep->ce_vardata, "privmsg"))
                    ;
                else if (!strcmp(cep->ce_vardata, "notice"))
                    ;
                else
                {
                    config_error("%s:%i: unknown chansno::msgtype '%s'",
                        cep->ce_fileptr->cf_filename, cep->ce_varlinenum,
                        cep->ce_varname);
                    errors++;
                }
            }
            else
            {
                config_error("%s:%i: unknown directive chansno::%s",
                    cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
                errors++;
            }
        }
        *errs = errors;
        return errors ? -1 : 1;
    }
    else
        return 0;
}

DLLFUNC int conf_chansno(ConfigFile *cf, ConfigEntry *ce, int type)
{
    ConfigEntry    *cep, *cepp;
    OperFlag    *ofp;
    ChanSnoFlag    *ca;

    if (type != CONFIG_MAIN)
        return 0;

    if (!strcmp(ce->ce_varname, "chansno"))
    {
        for (cep = ce->ce_entries; cep; cep = cep->ce_next)
        {
            if (!strcmp(cep->ce_varname, "channel"))
            {
                ca = MyMallocEx(sizeof(ChanSnoFlag));
                ircstrdup(ca->channel, cep->ce_vardata);

                for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
                {
                    if ((ofp = config_binary_flags_search(_ChanSnoFlags, cepp->ce_varname, CHSNO_TABLESIZE)))
                        ca->flags |= ofp->flag;
                }

                AddListItem(ca, ConfChanSno);
            }
            else if (!strcmp(cep->ce_varname, "msgtype"))
            {
                if (!strcmp(cep->ce_vardata, "privmsg"))
                    msgtype = MT_PRIVMSG;
                else if (!strcmp(cep->ce_vardata, "notice"))
                    msgtype = MT_NOTICE;
            }
        }

        return 1;
    }

    return 0;
}

// ===============================================================
// Functions used by m_chansno
// ===============================================================

static char *get_flag_names(long flags)
{
    u_int    i, found = 0;

    memset(&msgbuf, 0, sizeof msgbuf);

    for (i = 0; i < CHSNO_TABLESIZE; i++)
            if (flags & _ChanSnoFlags[i].flag)
        {
            if (found)
                strncat(msgbuf, ", ", MaxSize);
            else
                found = 1;

            strncat(msgbuf, _ChanSnoFlags[i].name, MaxSize);
        }

    if (!strlen(msgbuf))
        strcpy(msgbuf, "<None>");

    return msgbuf;
}

static void stats_chansno_channels(aClient *sptr)
{
    ChanSnoFlag    *c;
   
    for (c = ConfChanSno; c; c = c->next)
        sendto_one(sptr,  "%s %i %s :Kanal %s: %s",
            me.name, RPL_TEXT, sptr->name,
            c->channel, get_flag_names(c->flags));

    sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'S');
}

static void stats_chansno_config(aClient *sptr)
{
    ChanSnoFlag    *c;
   
    sendto_one(sptr, ":%s %i %s :msgtype: %s",
        me.name, RPL_TEXT, sptr->name, MsgType);
    sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'S');
}

// ===============================================================
// m_chansno
//      parv[0]: sender prefix
//      parv[1]: option
//      parv[2]: server name (optional)
// ===============================================================

DLLFUNC int m_chansno(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
    if (!IsPerson(sptr))
        return -1;

    if (!IsAnOper(sptr))
    {
        sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
        return -1;
    }

    if (!IsParam(1))
    {
        sendto_one(sptr, ":%s NOTICE %s :Kullanimi:",
            me.name, sptr->name);
        sendto_one(sptr, ":%s NOTICE %s :    /chansno <tercih> [<serveradi>]",
            me.name, sptr->name);
        sendto_one(sptr, ":%s NOTICE %s :Ozellikleri:",
            me.name, sptr->name);
        sendto_one(sptr, ":%s NOTICE %s :    list: displays the chansno::channel block list",
            me.name, sptr->name);
        sendto_one(sptr, ":%s NOTICE %s :    config: shows the rest of chansno configuration",
            me.name, sptr->name);
        return 0;
    }

        if (IsParam(2))
        {
                if (hunt_server_token(cptr, sptr, MSG_CHANSNO, TOK_CHANSNO,
                    "%s", 2, parc, parv) != HUNTED_ISME)
                        return 0;
        }

    if (!strcasecmp(parv[1], "list"))
        stats_chansno_channels(sptr);
    else if (!strcasecmp(parv[1], "config"))
        stats_chansno_config(sptr);
    else
    {
        sendto_one(sptr, ":%s NOTICE %s :Hatali option %s."
            " Valid options are: list | config",
            me.name, sptr->name, parv[1]);
        return -1;
    }

    return 0;
}

// ===============================================================
// Interface for sending notifications
// ===============================================================

#define SendBuf_simple \
    if ((sendto = find_channel(c->channel, NullChn)) != NullChn) \
        sendto_channel_butone(&me, &me, sendto, ":%s %s %s :%s", \
            me.name, MsgType, sendto->chname, msgbuf)

#define SendBuf_channel \
    if (!find_sno_channel(chptr) && (sendto = find_channel(c->channel, NullChn)) != NullChn) \
        sendto_channel_butone(&me, &me, sendto, ":%s %s %s :%s", \
            me.name, MsgType, sendto->chname, msgbuf)

static u_int find_sno_channel(aChannel *chptr)
{
    ChanSnoFlag    *c;
   
    for (c = ConfChanSno; c; c = c->next)
        if (!strcasecmp(chptr->chname, c->channel))
            return 1;

    return 0;
}

static void SendNotice_simple(long type)
{
    ChanSnoFlag    *c;
    aChannel    *sendto;

    for (c = ConfChanSno; c; c = c->next)
    {
        if (c->flags & type)
            SendBuf_simple;
    }
}

static void SendNotice_channel(aChannel *chptr, long type)
{
    ChanSnoFlag    *c;
    aChannel    *sendto;

    for (c = ConfChanSno; c; c = c->next)
    {
        if (c->flags & type)
            SendBuf_channel;
    }
}


DLLFUNC int cb_mode(aClient *cptr, aClient *sptr, aChannel *chptr,
  char *modebuf, char *parabuf, TS sendts, int samode)
{
    snprintf(msgbuf, BUFSIZE, "(%s) rumuzu (%s) kanalina mod ayarini degistirerek (%s%s%s) yapti",
        sptr->name, chptr->chname, modebuf,
        BadPtr(parabuf) ? "" : " ",
        BadPtr(parabuf) ? "" : parabuf);

    SendNotice_channel(chptr, CHSNO_CHANMODE);
    return 0;
}

DLLFUNC int cb_connect(aClient *sptr)
{
    snprintf(msgbuf, BUFSIZE, "(%s) (%s@%s) rumuzu (%d) portu üzerinden sunucuya baglanti kurdu. [%s] %s%s%s",
        sptr->name, sptr->user->username, sptr->user->realhost, sptr->listener->port,
            sptr->class ? sptr->class->name : "",
#ifdef USE_SSL
        IsSecure(sptr) ? "[secure " : "",
        IsSecure(sptr) ? SSL_get_cipher((SSL *)sptr->ssl) : "",
        IsSecure(sptr) ? "]" : "");
#else
        "", "", "");
#endif

    SendNotice_simple(CHSNO_CONNECT);
    return 0;
}

DLLFUNC int cb_quit(aClient *sptr, char *comment)
{
    snprintf(msgbuf, BUFSIZE, " (%s) (%s@%s) rumuzu sunucudan ayrildi. (%s)",
        sptr->name, sptr->user->username,
        sptr->user->realhost, comment);

    SendNotice_simple(CHSNO_DISCONNECT);
    return 0;
}

DLLFUNC int cb_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *parv[])
{
    snprintf(msgbuf, BUFSIZE, " (%s) (%s@%s) rumuzu (%s) kanalina giris yapti",
        sptr->name, sptr->user->username, sptr->user->realhost,
        chptr->chname);

    SendNotice_channel(chptr, CHSNO_JOIN);
    return 0;
}

DLLFUNC int cb_kick(aClient *cptr, aClient *sptr, aClient *who, aChannel *chptr, char *comment)
{
    snprintf(msgbuf, BUFSIZE, " (%s) kanal operatoru (%s) (%s) rumuzunu kanaldan uzaklastirdi (%s)",
        chptr->chname, sptr->name, who->name, comment);

    SendNotice_channel(chptr, CHSNO_KICK);
    return 0;
}

DLLFUNC int cb_nickchange(aClient *sptr, char *nick)
{
    snprintf(msgbuf, BUFSIZE, " (%s) (%s@%s) rumuzu nick degistirdi ve (%s) oldu",
        sptr->name, sptr->user->username, sptr->user->realhost, nick);

    SendNotice_simple(CHSNO_NICKCHANGE);
    return 0;
}

DLLFUNC int cb_part(aClient *cptr, aClient *sptr, aChannel *chptr, char *comment)
{
    snprintf(msgbuf, BUFSIZE, " (%s) (%s@%s) rumuzu (%s) kanalindan cikis yapti (%s)",
        sptr->name, sptr->user->username, sptr->user->realhost,
        chptr->chname, comment ? comment : sptr->name);

    SendNotice_channel(chptr, CHSNO_PART);
    return 0;
}

DLLFUNC int cb_server_connect(aClient *sptr)
{
    if (!MyConnect(sptr))
        return 0;

    snprintf(msgbuf, BUFSIZE, "(%s) (%s) rumuzu (%d) portu üzerinden sunucuya baglanti kurdu. [%s] %s%s%s %s ", sptr->name, sptr->info, sptr->listener->port,
            sptr->class ? sptr->class->name : "",
#ifdef USE_SSL
        IsSecure(sptr) ? "[secure " : "",
        IsSecure(sptr) ? SSL_get_cipher((SSL *)sptr->ssl) : "",
        IsSecure(sptr) ? "]" : "",
#else
        "", "", "",
#endif

#ifdef ZIP_LINKS
        IsZipped(sptr) ? " [zip]" : "");
#else
        "");
#endif

    SendNotice_simple(CHSNO_SCONNECT);
    return 0;
}

DLLFUNC int cb_server_quit(aClient *sptr)
{
    if (!MyConnect(sptr))
        return 0;

    /* The hook supports no reason :-( */
    snprintf(msgbuf, BUFSIZE, "(%s) rumuzu sunucudan ayrildi.", sptr->name);

    SendNotice_simple(CHSNO_SQUIT);
    return 0;
}

DLLFUNC int cb_topic(aClient *cptr, aClient *sptr, aChannel *chptr, char *topic)
{
    snprintf(msgbuf, BUFSIZE, "(%s) kanalinin giris metni(topik) (%s) tarafindan degistirilerek (%s) yapildi",
        chptr->chname, sptr->name, topic);

    SendNotice_channel(chptr, CHSNO_SQUIT);
    return 0;
}

Tarih fonksiyonu kaldırıldı, renklendirme olayınıda kendin yaparsın herhalde yapman gereken mIRC programın açıkken Ctrl + k tuşlarını kullanarak çıkan renk tonlarını seçip ilgili yerlere eklemek olacaktır..

İyi forumlar.. ^^


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

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