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/)
-   -   m_helponly.c ( +H Kanal Modesi ) (https://www.ircforumlari.net/hazir_kodlar/394459-m_helponlyc-h-kanal-modesi.html)

Ldunda 23 Mayıs 2011 03:24

m_helponly.c ( +H Kanal Modesi )
 
Bilindiği üzere hemen her sunucuda helperların giriş yapmak zorunda oldukları mecburi kanallar vardır. ( helpers,helpsop,helpdesk vb. ) Bu kanallarada genel olarak Access erişimi ile girişler kısıtlanır. "+H" kanal modesi ile +O , +A modelerinde olduğu gibi sadece belirtilen modeyi yani "+h" modesini alan Help Operatörler o kanala girebilir. Kanal modesini aktif etmek içinde HelpOp konumunda olmak gereklidir.

Modul ismi : m_helponly



Kod:

/*
 * Filename:    m_helponly.c
 * Description : Channel mode +H ( HelpOp Only )
 * Author:      Ldunda <
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
>
 */

#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

#define ERR_HELPONLY                410

ModuleHeader MOD_HEADER(m_helponly)
  = {
        "m_helponly",
        "Channel mode +H ( Helpop Only )",
        "Channel mode +H ( Helpop Only ) ( By Ldunda )",
        "3.2-b8-1",
        NULL
    };
   
static Cmode                *AddCmode(Module *module, CmodeInfo *req, Cmode_t *mode);
static int                        help_is_ok(aClient *, aChannel *, char *, int, int);
static int                        help_only_join(aClient *, aChannel *, char *[]);

Cmode                                *ModeHelpOnly;
Cmode_t                                MODE_HELPONLY = 0L;
Hook                                *HookPreJoin;

DLLFUNC int MOD_INIT(m_helponly)(ModuleInfo *modinfo)
{
        CmodeInfo req;
        memset(&req, 0, sizeof req);
        req.paracount        = 0;
        req.is_ok                = help_is_ok;
        req.flag                = 'H';
        ModeHelpOnly                = AddCmode(modinfo->handle, &req, &MODE_HELPONLY);
        HookPreJoin = HookAddEx(modinfo->handle, HOOKTYPE_PRE_LOCAL_JOIN, help_only_join);

        return MOD_SUCCESS;
}

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

DLLFUNC int MOD_UNLOAD(m_helponly)(int module_unload)
{
        return MOD_FAILED;
}

static Cmode *AddCmode(Module *module, CmodeInfo *req, Cmode_t *mode)
{
        Cmode *cmode;
        *mode = 0;
        cmode = CmodeAdd(module, *req, mode);
}

static int help_is_ok(aClient *sptr, aChannel *chptr, char *para, int type, int what)
{
        if ((type == EXCHK_ACCESS) || (type == EXCHK_ACCESS_ERR))
        {
                if (!is_chan_op(sptr, chptr))
                {
                        if (type == EXCHK_ACCESS_ERR)
                                sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
                                        me.name, sptr->name, chptr->chname);
                        return 0;
                }

                if (!(sptr->umodes & UMODE_HELPOP))
                {
                        if (type == EXCHK_ACCESS_ERR)
                                sendto_one(sptr, ":%s %d %s :Permission Denied- You do not have the correct Help Operator privileges",
                                me.name, ERR_HELPONLY, sptr->name);
                        return 0;
                }

                return 1;
        }

        return 0;
}

static int help_only_join(aClient *sptr, aChannel *chptr, char *parv[])
{
        if ((chptr->mode.extmode & MODE_HELPONLY) && !IsHelpOp(sptr))
        {
                sendto_one(sptr, ":%s %d %s :Cannot join channel %s (Help Operator Only)",
                        me.name, ERR_HELPONLY, sptr->name, chptr->chname);

                return 1;
        }

        return 0;
}

İyi Çalışmalar...

MesqeN 15 Aralık 2013 23:18

Cevap: m_helponly.c ( +H Kanal Modesi )
 
ModuL Aktif. Fakat işlevi yok : Örnek


[23:17:17] * MesqeN kanal modu kurdu: +H
[KBSC] [ 23::17 ] *** Giriş: Asit ([Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...])


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

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