IRCDefteri - En İyi IRCForum Sayfasi

IRCDefteri - En İyi IRCForum Sayfasi (https://www.ircforumda.net/)
-   Unreal IRCd (https://www.ircforumda.net/unreal-ircd/)
-   -   Özelleri Kapatma Modülü +D Flagesi (https://www.ircforumda.net/unreal-ircd/41692-ozelleri-kapatma-modulu-d-flagesi.html)

Emre 14.Ocak.2023 20:01

Özelleri Kapatma Modülü +D Flagesi
 
Unreal IRC Sohbet Sitelerinizde Özellerinizi Kapatmaya yarayan bir modüldür. Kullanimi /mode absolut +D gibi..

Kurulumunu yapmak için Putty ile hesabiza login olunuz.. SirayLa şu komutLari yaziniz.

daha sonra FTP ile hesabiniza giriniz Unreal3.2/src/modules klasörüne gönderiniz.

cd Unreal3.2
make custommodule MODULEFILE=m_privdeaf
yazdiktan sonra unrealircd.conf dosyasinin içinede şu kodu ekliyorsunuz..

loadmodule “src/modules/m_privdeaf.so”;
yazip kaydediyoruz.. Kaydetmek için CTRL+X ve y basiyoruz..

/rehash cekiniz modül kurulmuştur.. /module yazip kurulu modülleri görebilirsiniz.



Kod:

/*
 * usermode +D: makes it so you cannot receive private messages/notices
 * except from opers, U-lines and servers. -- Syzop
 */

#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include
#include
#include
#include
#include
#ifdef _WIN32
#include
#endif
#include
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif

#ifndef DYNAMIC_LINKING
ModuleHeader m_privdeaf_Header
#else
#define m_privdeaf_Header Mod_Header
ModuleHeader Mod_Header
#endif
  = {
        "Özel Koruma",        /* Name of module */
        "v0.0.6", /* Version */
        "/mode nick +D", /* Short description of module */
        "3.2-b8-1",
        NULL
    };

static long UMODE_PRIVDEAF = 0;
static Umode *UmodePrivdeaf = NULL;
static Hook *CheckMsg;

DLLFUNC char *privdeaf_checkmsg(aClient *, aClient *, aClient *, char *, int);

DLLFUNC int MOD_INIT(m_privdeaf)(ModuleInfo *modinfo)
{
        UmodePrivdeaf = UmodeAdd(modinfo->handle, 'D', UMODE_GLOBAL, umode_allow_all, &UMODE_PRIVDEAF);
        if (!UmodePrivdeaf)
        {
                /* I use config_error() here because it's printed to stderr in case of a load
                * on cmd line, and to all opers in case of a /rehash.
                */
                config_error("m_privdeaf: Could not add usermode 'D': %s", ModuleGetErrorStr(modinfo->handle));
                return MOD_FAILED;
        }
       
        CheckMsg = HookAddPCharEx(modinfo->handle, HOOKTYPE_USERMSG, privdeaf_checkmsg);

        /* Ah well.. we'll just go perm for now. */
        ModuleSetOptions(modinfo->handle, MOD_OPT_PERM);

        return MOD_SUCCESS;
}

DLLFUNC int MOD_LOAD(m_privdeaf)(int module_load)
{
        return MOD_SUCCESS;
}

DLLFUNC int MOD_UNLOAD(m_privdeaf)(int module_unload)
{
        return MOD_SUCCESS;
}

DLLFUNC char *privdeaf_checkmsg(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
        if ((acptr->umodes & UMODE_PRIVDEAF) && !IsAnOper(sptr) && !IsULine(sptr) && !IsServer(sptr))
        {
                sendnotice(sptr, "Uyari '%s' Nickli Kullanicinin Özelleri Kapali Durumdadir. Mesaj Gönderemezsiniz!", acptr->name);
                return NULL;
        } else
                return text;
}


HoLyOne 14.Ocak.2023 20:09

Cevap: Özelleri Kapatma Modülü +D Flagesi
 
Emeğine sağlık

Overdose 20.Şubat.2023 14:29

Cevap: Özelleri Kapatma Modülü +D Flagesi
 
emeklerine SAglık Can


Forum Saati: 10:13. Zaman dilimi GMT +4 olarak ayarlanmıştır.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.