PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
#include "module.h"
#define AUTHOR "n00bie"
#define VERSION "$Id: ns_joinradiochan.c v1.0.1 14-01-2007 n00bie $"
/* -------------------------------------------------------------------------------
* Name : ns_joinradiochan.c
* Author : n00bie
* Version : 1.0.1
* Date : 06-09-2006
* Updated : 14-01-2007
* -------------------------------------------------------------------------------
* Tested & Supported: Unreal3.2.6, InspIRCd, PTlink, UltimateIRCd2, ViagraIRCd
*
* Description: When a user having HalfOP access and above on the Network Help
* channel identify his nick to services, this module will forcefully join the
* user to the network Help Channel (which is defined on services.conf).
* If the user have no access on the Help Channel nothing is done.
*
* NOTE: In order for this module to work RadioChannel must be enabled or defined
* in services.conf
* --------------------------------------------------------------------------------
* Changelog:
* v1.0.0 - First Public Release.
* v1.0.1 - Minor Code Update.
* Added support for InspIRCd, PTlink, UltimateIRCd2, ViagraIRCd.
* --------------------------------------------------------------------------------
* This module have no configurable option.
*/
#define RadioChannel "#radyo"
int joinradio(User *u);
int AnopeInit(int argc, char **argv)
{
Command *c;
c = createCommand("ID", joinradio, NULL, -1, -1, -1, -1, -1);
moduleAddCommand(NICKSERV, c, MOD_TAIL);
c = createCommand("IDENTIFY", joinradio, NULL, -1, -1, -1, -1, -1);
moduleAddCommand(NICKSERV, c, MOD_TAIL);
if (!RadioChannel) {
alog("\002RadioChannel\002 is not enabled in services.conf. Unloading module.");
return MOD_STOP;
} else {
alog("%s: ns_joinradiochan: Successfully loaded module.", s_NickServ);
}
moduleAddAuthor(AUTHOR);
moduleAddVersion(VERSION);
return MOD_CONT;
}
int joinradio(User *u)
{
ChannelInfo *ci = cs_findchan(RadioChannel);
if (check_access(u, ci, CA_HALFOP) || check_access(u, ci, CA_HALFOPME)) {
anope_cmd_svsjoin(s_NickServ, u->nick, RadioChannel);
if (!stricmp(IRCDModule, "inspircd") ||
!stricmp(IRCDModule, "ptlink") ||
!stricmp(IRCDModule, "ultimate2") ||
!stricmp(IRCDModule, "unreal32") ||
!stricmp(IRCDModule, "viagra")) {
anope_cmd_svsjoin(s_ChanServ, u->nick, RadioChannel);
send_cmd(s_HostServ, "CHGHOST %s Dj.servername.net", u->nick, u->nick);
}
}
return MOD_CONT;
}
void AnopeFini(void)
{
alog("%s: ns_joinradiochan%s: Module Unloaded.", s_NickServ, MODULE_EXT);
}
/* EOF */