1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 06:36:39 +02:00

BUILD : 1.7.8 (626) BUGS : N/A NOTES : Moved the protect defines out of the ircd protocol header files.

git-svn-id: svn://svn.anope.org/anope/trunk@626 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@474 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b
2005-03-15 23:18:30 +00:00
parent 1d4db8b86d
commit f52c92f2d8
34 changed files with 94 additions and 146 deletions
-9
View File
@@ -15,15 +15,6 @@
#ifdef IRC_BAHAMUT
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001 /* umode +a - Services Admin */
#define UMODE_h 0x00000002 /* umode +h - Helper */
-10
View File
@@ -13,16 +13,6 @@
#ifdef IRC_DREAMFORGE
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001 /* Services Admin */
#define UMODE_h 0x00000002 /* Help system operator */
#define UMODE_i 0x00000004 /* makes user invisible */
+1
View File
@@ -134,6 +134,7 @@ E void do_mass_mode(char *modes);
E ChannelInfo *chanlists[256];
E CSModeUtil csmodeutils[];
E LevelInfo levelinfo[];
E void listchans(int count_only, const char *chan);
E void get_chanserv_stats(long *nrec, long *memuse);
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_HYBRID
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001 /* Admin status */
#define UMODE_b 0x00000080 /* See bot and drone flooding notices */
+6
View File
@@ -330,6 +330,12 @@ int moduleDataDebug(ModuleData **md); /* Allow for debug output of a moduleD
MDE boolean moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */
/*************************************************************************/
/* Some IRCD protocol module support functions */
/** Update the protect deatials, could be either protect or admin etc.. */
MDE void updateProtectDetails(char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode);
/************************************************************************/
#endif
/* EOF */
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_PLEXUS
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "+"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_PTLINK
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_RAGE2
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define FANT_PROTECT_ADD "!admin"
#define FANT_PROTECT_DEL "!deadmin"
#define LEVEL_PROTECT_WORD "AUTOADMIN"
#define LEVELINFO_PROTECT_WORD "ADMIN"
#define LEVELINFO_PROTECTME_WORD "ADMINME"
#define CS_CMD_PROTECT "ADMIN"
#define CS_CMD_DEPROTECT "DEADMIN"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_RATBOX
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_C 0x00000002
+9
View File
@@ -245,6 +245,8 @@ typedef enum { false, true } boolean;
#include "ratbox.h"
#include "shadowircd.h"
typedef struct ircdvars_ IRCDVar;
typedef struct ircdcapab_ IRCDCAPAB;
@@ -747,6 +749,13 @@ struct csmodeutil_ {
int levelself; /* Level required to use the command for himself */
};
typedef struct {
int what;
char *name;
int desc;
} LevelInfo;
/*************************************************************************/
/* Server data */
-9
View File
@@ -16,15 +16,6 @@
/* The protocol revision. */
#define PROTOCOL_REVISION 3402
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_C 0x00000002
-10
View File
@@ -15,16 +15,6 @@
#ifdef IRC_SOLID
#define PROTECT_SET_MODE "+"
#define PROTECT_UNSET_MODE "-"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001 /* umode +a - Services Admin */
#define UMODE_h 0x00000002 /* umode +h - Helper */
#define UMODE_i 0x00000004 /* umode +i - Invisible */
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_ULTIMATE2
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_ULTIMATE3
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define FANT_PROTECT_ADD "!admin"
#define FANT_PROTECT_DEL "!deadmin"
#define LEVEL_PROTECT_WORD "AUTOADMIN"
#define LEVELINFO_PROTECT_WORD "ADMIN"
#define LEVELINFO_PROTECTME_WORD "ADMINME"
#define CS_CMD_PROTECT "ADMIN"
#define CS_CMD_DEPROTECT "DEADMIN"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-9
View File
@@ -15,15 +15,6 @@
#ifdef IRC_UNREAL31
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
-15
View File
@@ -77,21 +77,6 @@
#define CMODE_T 0x02000000
#define CMODE_M 0x04000000
/*************************************************************************/
/* Since we differ !protect from !admin we need to know what to use */
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
/*************************************************************************/
/* Default Modes with MLOCK */
-9
View File
@@ -13,15 +13,6 @@
#ifdef IRC_VIAGRA
#define PROTECT_SET_MODE "+a"
#define PROTECT_UNSET_MODE "-a"
#define CS_CMD_PROTECT "PROTECT"
#define CS_CMD_DEPROTECT "DEPROTECT"
#define FANT_PROTECT_ADD "!protect"
#define FANT_PROTECT_DEL "!deprotect"
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
#define LEVELINFO_PROTECT_WORD "PROTECT"
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
/* User Modes */
#define UMODE_A 0x00000040 /* Is a Server Administrator. */
+5
View File
@@ -643,6 +643,11 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
/* first update the cs protect info about this ircd */
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
/* now add the commands */
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+6 -11
View File
@@ -62,17 +62,12 @@ static int def_levels[][2] = {
{ -1 }
};
typedef struct {
int what;
char *name;
int desc;
} LevelInfo;
static LevelInfo levelinfo[] = {
LevelInfo levelinfo[] = {
{ CA_AUTODEOP, "AUTODEOP", CHAN_LEVEL_AUTODEOP },
{ CA_AUTOHALFOP, "AUTOHALFOP", CHAN_LEVEL_AUTOHALFOP },
{ CA_AUTOOP, "AUTOOP", CHAN_LEVEL_AUTOOP },
{ CA_AUTOPROTECT, LEVEL_PROTECT_WORD, CHAN_LEVEL_AUTOPROTECT },
{ CA_AUTOPROTECT, "", CHAN_LEVEL_AUTOPROTECT },
{ CA_AUTOVOICE, "AUTOVOICE", CHAN_LEVEL_AUTOVOICE },
{ CA_NOJOIN, "NOJOIN", CHAN_LEVEL_NOJOIN },
{ CA_SIGNKICK, "SIGNKICK", CHAN_LEVEL_SIGNKICK },
@@ -92,8 +87,8 @@ static LevelInfo levelinfo[] = {
{ CA_INVITE, "INVITE", CHAN_LEVEL_INVITE },
{ CA_OPDEOP, "OPDEOP", CHAN_LEVEL_OPDEOP },
{ CA_OPDEOPME, "OPDEOPME", CHAN_LEVEL_OPDEOPME },
{ CA_PROTECT, LEVELINFO_PROTECT_WORD, CHAN_LEVEL_PROTECT },
{ CA_PROTECTME, LEVELINFO_PROTECTME_WORD, CHAN_LEVEL_PROTECTME },
{ CA_PROTECT, "", CHAN_LEVEL_PROTECT },
{ CA_PROTECTME, "", CHAN_LEVEL_PROTECTME },
{ CA_TOPIC, "TOPIC", CHAN_LEVEL_TOPIC },
{ CA_UNBAN, "UNBAN", CHAN_LEVEL_UNBAN },
{ CA_VOICE, "VOICE", CHAN_LEVEL_VOICE },
@@ -116,8 +111,8 @@ CSModeUtil csmodeutils[] = {
{ "VOICE", "!voice", "+v", 0 , CA_VOICE, CA_VOICEME },
{ "DEHALFOP", "!dehalfop", "-h", 0 , CA_HALFOP, CA_HALFOPME },
{ "HALFOP", "!halfop", "+h", 0 , CA_HALFOP, CA_HALFOPME },
{ "DEPROTECT", FANT_PROTECT_DEL, PROTECT_UNSET_MODE, 0 , CA_PROTECT, CA_PROTECTME },
{ "PROTECT", FANT_PROTECT_ADD, PROTECT_SET_MODE, 0 , CA_PROTECT, CA_PROTECTME },
{ "DEPROTECT", "", "", 0 , CA_PROTECT, CA_PROTECTME },
{ "PROTECT", "", "", 0 , CA_PROTECT, CA_PROTECTME },
{ NULL }
};
+3
View File
@@ -460,8 +460,11 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+2
View File
@@ -627,6 +627,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+34
View File
@@ -2124,4 +2124,38 @@ const char *ano_moderr(void)
}
#endif
/**
* Allow ircd protocol files to update the protect level info tables.
**/
void updateProtectDetails(char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode) {
int i = 0;
CSModeUtil ptr;
LevelInfo l_ptr;
ptr = csmodeutils[i];
while(ptr.name) {
if(strcmp(ptr.name,"PROTECT")==0) {
csmodeutils[i].bsname = strdup(fant_protect_add);
csmodeutils[i].mode = strdup(protect_set_mode);
} else if(strcmp(ptr.name,"DEPROTECT")==0) {
csmodeutils[i].bsname = strdup(fant_protect_del);
csmodeutils[i].mode = strdup(protect_unset_mode);
}
ptr = csmodeutils[++i];
}
i = 0;
l_ptr = levelinfo[i];
while(l_ptr.what != -1) {
if(l_ptr.what == CA_PROTECT) {
levelinfo[i].name = strdup(level_info_protect_word);
} else if(l_ptr.what == CA_PROTECTME) {
levelinfo[i].name = strdup(level_info_protectme_word);
} else if(l_ptr.what == CA_AUTOPROTECT) {
levelinfo[i].name = strdup(level_protect_word);
}
l_ptr = levelinfo[++i];
}
}
/* EOF */
+2
View File
@@ -687,6 +687,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+2
View File
@@ -526,6 +526,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+2
View File
@@ -505,6 +505,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("ADMIN","ADMINME","!admin","!deadmin","AUTOADMIN","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+2
View File
@@ -732,6 +732,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void)
{
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
if (UseTS6) {
TS6SID = sstrdup(Numeric);
+2
View File
@@ -736,6 +736,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void)
{
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
TS6SID = sstrdup(Numeric);
UseTS6 = 1;
+2
View File
@@ -649,6 +649,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+2
View File
@@ -592,6 +592,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+2
View File
@@ -594,6 +594,8 @@ int anope_event_client(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("ADMIN","ADMINME","!admin","!deadmin","AUTOADMIN","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+2
View File
@@ -433,6 +433,8 @@ void anope_set_umode(User * user, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+2
View File
@@ -486,6 +486,8 @@ void anope_set_umode(User * user, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+2
View File
@@ -674,6 +674,8 @@ int anope_event_error(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
+6 -1
View File
@@ -8,10 +8,15 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="8"
VERSION_BUILD="625"
VERSION_BUILD="626"
# $Log$
#
# BUILD : 1.7.8 (626)
# BUGS : N/A
# NOTES : Moved the protect defines out of the ircd protocol header files.
#
#
# BUILD : 1.7.8 (625)
# BUGS : 319
# NOTES : Globalized do_getkey by DrStein.