* PrefixHost modülü sizin belirtmiş olduğunuz herhangi bir oda içerisinde Aop(@), Sop(&), Founder(~.) prefixlerini alan kullanıcılara, otomatik olarak modül üzerinden belirtmiş olduğunuz hostu vermektedir.
NOT; Test edilen sürüm Unreal3.2.10.1
m_prefixhost.c modülü;
Kod :
/* Düzenleme Tarihi: -> 15.03.2014 */
/* Açıklama: -> Bu modül IRCALEM FORUM üzerinde "-> X <-" kullanıcısı'nın ricası üzerine AutoHelper modülü içerisinden bir takım kodlar alınarak, -> Aop(@), Sop(@), Founder(~.) ve AutoHost işlemlerini yapması için, düzenlenmiştir. */
#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"
#include "proto.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
/* Burdan, hostları düzenleyebilirsiniz */
char AopHost[]="GlobalOp.hobichat.net";
char SopHost[]="GlobalSop.hobichat.net";
char FounderHost[]="Founder.hobichat.net";
/* Modül ismi, ve açıklaması */
#define Module "m_prefixhost.c"
#define Aciklama "AutoHost modulu by Entrance"
static int m_GlobalSop(aClient *, aClient *, aChannel *, char *, char *, TS, int);
static int m_GlobalOp(aClient *, aClient *, aChannel *, char *, char *, TS, int);
static int m_GlobalFounder(aClient *, aClient *, aChannel *, char *, char *, TS, int);
ModuleHeader MOD_HEADER(m_nidentd)
= {
Module,
Aciklama,
Aciklama,
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_nidentd)(ModuleInfo *modinfo)
{
HookAddEx(modinfo->handle, HOOKTYPE_REMOTE_CHANMODE, m_GlobalOp);
HookAddEx(modinfo->handle, HOOKTYPE_REMOTE_CHANMODE, m_GlobalSop);
HookAddEx(modinfo->handle, HOOKTYPE_REMOTE_CHANMODE, m_GlobalFounder);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_nidentd)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_nidentd)(int module_unload)
{
return MOD_SUCCESS;
}
int GlobalOp(aClient *sptr) {
aChannel *E;
/* AOP için, eklenen GLOBAL kanallar aynı mantıkla çoğaltabilirsiniz. */
if (stricmp(E->chname,"#Sohbet") && stricmp(E->chname,"#Oyun") && stricmp(E->chname,"#Kelime") && stricmp(E->chname,"#Yarisma"))
if (IsServer(sptr) && IsULine(sptr) && IsOper(sptr))
return 0;
sptr->user->virthost = strdup(AopHost);
}
int GlobalSop(aClient *sptr) {
aChannel *E2;
/* SOP için, eklenen GLOBAL kanallar aynı mantıkla çoğaltabilirsiniz. */
if (stricmp(E2->chname,"#Sohbet") && stricmp(E2->chname,"#Oyun") && stricmp(E2->chname,"#Kelime") && stricmp(E2->chname,"#Yarisma"))
if (IsServer(sptr) && IsULine(sptr) && IsOper(sptr))
return 0;
sptr->user->virthost = strdup(SopHost);
}
int GlobalFounder(aClient *sptr) {
aChannel *E3;
/* FOUNDER için, eklenen GLOBAL kanallar aynı mantıkla çoğaltabilirsiniz. */
if (stricmp(E3->chname,"#Sohbet") && stricmp(E3->chname,"#Oyun") && stricmp(E3->chname,"#Kelime") && stricmp(E3->chname,"#Yarisma"))
if (IsServer(sptr) && IsULine(sptr) && IsOper(sptr))
return 0;
sptr->user->virthost = strdup(FounderHost);
}
static int m_GlobalOp(aClient *cptr, aClient *sptr, aChannel *chptr, char *modebuf, char *parabuf, TS sendts, int samode) {
char *p, *prefix, *prefix2;
aClient *pre;
if (stricmp(sptr->name,"ChanServ"))
return 0;
if (!strcmp(modebuf,"+o")) {
prefix = strtoken(&p, parabuf, " ");
if (!BadPtr(parabuf)) {
if ((pre = find_client(parabuf, NULL))) {
GlobalOp(pre);
return 0;
}
}
}
}
static int m_GlobalSop(aClient *cptr, aClient *sptr, aChannel *chptr, char *modebuf, char *parabuf, TS sendts, int samode) {
char *p, *prefixx, *prefixx2;
aClient *pree;
if (stricmp(sptr->name,"ChanServ"))
return 0;
if (!strcmp(modebuf,"+oa")) {
prefixx = strtoken(&p, parabuf, " ");
if (!BadPtr(parabuf)) {
if ((pree = find_client(parabuf, NULL))) {
GlobalSop(pree);
return 0;
}
}
}
}
static int m_GlobalFounder(aClient *cptr, aClient *sptr, aChannel *chptr, char *modebuf, char *parabuf, TS sendts, int samode) {
char *p, *prefixxx, *prefixxx2;
aClient *preee;
if (stricmp(sptr->name,"ChanServ"))
return 0;
if (!strcmp(modebuf,"+oq")) {
prefixxx = strtoken(&p, parabuf, " ");
if (!BadPtr(parabuf)) {
if ((preee = find_client(parabuf, NULL))) {
GlobalFounder(preee);
return 0;
}
}
}
}
“İnsanların en hayırlısı, insanlara faydalı olandır”. H.Ş.