mirror of
https://github.com/anope/anope.git
synced 2026-07-10 16:23:13 +02:00
Rewrote all of the defcon code, and moved most of it to os_defcon. This fixes defcon to have the ability to use modes introduced to Anope at a later time than on startup (eg, from the IRCd), amongst other things
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2597 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+6
-6
@@ -389,9 +389,6 @@ E int NumUlines;
|
||||
E int read_config(int reload);
|
||||
|
||||
E int DefConLevel;
|
||||
E int DefCon[6];
|
||||
E int checkDefCon(int level);
|
||||
E void resetDefCon(int level);
|
||||
E int DefConSessionLimit;
|
||||
E time_t DefConTimeOut;
|
||||
E time_t DefConAKILL;
|
||||
@@ -692,10 +689,13 @@ E int check_szline(const char *nick, char *ip);
|
||||
|
||||
E Server *server_global(Server * s, char *msg);
|
||||
|
||||
E bool CheckDefCon(DefconLevel Level);
|
||||
E bool CheckDefCon(int level, DefconLevel Level);
|
||||
E void AddDefCon(int level, DefconLevel Level);
|
||||
E void DelDefCon(int level, DefconLevel Level);
|
||||
E std::vector<std::bitset<32> > DefCon;
|
||||
|
||||
E bool OSOpersOnly;
|
||||
E time_t DefContimer;
|
||||
E void runDefCon();
|
||||
E int defconParseModeString(const char *str);
|
||||
|
||||
/**** process.c ****/
|
||||
|
||||
|
||||
+23
-8
@@ -558,6 +558,15 @@ class CoreExport Module
|
||||
*/
|
||||
virtual void OnUserNickChange(User *u, const char *oldnick) { }
|
||||
|
||||
/** Called immediatly when a user tries to run a command
|
||||
* @param service The service
|
||||
* @param u The user
|
||||
* @param cmd The command
|
||||
* @param c The command class (if it exists)
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||
*/
|
||||
virtual EventReturn OnPreCommandRun(const char *service, User *u, const char *cmd, Command *c) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called before a command is due to be executed.
|
||||
* @param u The user executing the command
|
||||
* @param service The service the command is associated with
|
||||
@@ -726,7 +735,7 @@ class CoreExport Module
|
||||
/** Called when defcon level changes
|
||||
* @param level The level
|
||||
*/
|
||||
virtual void OnDefconLevel(const char *level) { }
|
||||
virtual void OnDefconLevel(int level) { }
|
||||
|
||||
/** Called when a server quits
|
||||
* @param server The server
|
||||
@@ -818,6 +827,16 @@ class CoreExport Module
|
||||
*/
|
||||
virtual void OnDelChan(ChannelInfo *ci) { }
|
||||
|
||||
/** Called when a new channel is created
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnChannelCreate(Channel *c) { }
|
||||
|
||||
/** Called when a channel is deleted
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnChannelDelete(Channel *c) { }
|
||||
|
||||
/** Called when a nick is dropped
|
||||
* @param nick The nick
|
||||
*/
|
||||
@@ -859,11 +878,6 @@ class CoreExport Module
|
||||
*/
|
||||
virtual void OnNickUnsuspended(NickAlias *na) { }
|
||||
|
||||
/** Called when the defcon level is changed
|
||||
* @param level The level
|
||||
*/
|
||||
virtual void OnDefconLevel(int level) { }
|
||||
|
||||
/** Called on finduser()
|
||||
* @param u pointer to the user
|
||||
*/
|
||||
@@ -985,7 +999,8 @@ enum Implementation
|
||||
|
||||
/* ChanServ */
|
||||
I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange,
|
||||
I_OnAccessDel, I_OnAccessClear, I_OnChanRegistered, I_OnChanUnsuspend, I_OnDelChan,
|
||||
I_OnAccessDel, I_OnAccessClear, I_OnChanRegistered, I_OnChanUnsuspend, I_OnDelChan, I_OnChannelCreate,
|
||||
I_OnChannelDelete,
|
||||
|
||||
/* BotServ */
|
||||
I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign,
|
||||
@@ -1002,7 +1017,7 @@ enum Implementation
|
||||
I_OnDefconLevel,
|
||||
|
||||
/* Other */
|
||||
I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnPreCommand, I_OnPostCommand, I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnBackupDatabase,
|
||||
I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnPreCommandRun, I_OnPreCommand, I_OnPostCommand, I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnBackupDatabase,
|
||||
I_OnPreDatabaseExpire, I_OnDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal,
|
||||
I_OnServerQuit, I_OnTopicUpdated,
|
||||
I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword,
|
||||
|
||||
+16
-13
@@ -1426,19 +1426,22 @@ struct session_ {
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* DEFCON Defines
|
||||
**/
|
||||
#define DEFCON_NO_NEW_CHANNELS 1 /* No New Channel Registrations */
|
||||
#define DEFCON_NO_NEW_NICKS 2 /* No New Nick Registrations */
|
||||
#define DEFCON_NO_MLOCK_CHANGE 4 /* No MLOCK changes */
|
||||
#define DEFCON_FORCE_CHAN_MODES 8 /* Force Chan Mode */
|
||||
#define DEFCON_REDUCE_SESSION 16 /* Reduce Session Limit */
|
||||
#define DEFCON_NO_NEW_CLIENTS 32 /* Kill any NEW clients */
|
||||
#define DEFCON_OPER_ONLY 64 /* Restrict services to oper's only */
|
||||
#define DEFCON_SILENT_OPER_ONLY 128 /* Silently ignore non-opers */
|
||||
#define DEFCON_AKILL_NEW_CLIENTS 256 /* AKILL any new clients */
|
||||
#define DEFCON_NO_NEW_MEMOS 512 /* No New Memos Sent */
|
||||
|
||||
/* Defcon */
|
||||
enum DefconLevel
|
||||
{
|
||||
DEFCON_NO_NEW_CHANNELS,
|
||||
DEFCON_NO_NEW_NICKS,
|
||||
DEFCON_NO_MLOCK_CHANGE,
|
||||
DEFCON_FORCE_CHAN_MODES,
|
||||
DEFCON_REDUCE_SESSION,
|
||||
DEFCON_NO_NEW_CLIENTS,
|
||||
DEFCON_OPER_ONLY,
|
||||
DEFCON_SILENT_OPER_ONLY,
|
||||
DEFCON_AKILL_NEW_CLIENTS,
|
||||
DEFCON_NO_NEW_MEMOS
|
||||
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user