summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-22 03:16:11 -0400
committerAdam <Adam@anope.org>2011-05-16 04:06:17 -0400
commitc8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch)
tree4bc9ae029691d5e7c03ebc1481683a010b733844 /include
parent1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff)
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'include')
-rw-r--r--include/anope.h26
-rw-r--r--include/bots.h6
-rw-r--r--include/channels.h33
-rw-r--r--include/config.h56
-rw-r--r--include/extern.h89
-rw-r--r--include/logger.h2
-rw-r--r--include/modules.h75
-rw-r--r--include/oper.h (renamed from include/operserv.h)37
-rw-r--r--include/regchannel.h5
-rw-r--r--include/services.h70
-rw-r--r--include/sysconf.h.cmake2
11 files changed, 102 insertions, 299 deletions
diff --git a/include/anope.h b/include/anope.h
index 4f116c37e..7aa505661 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -468,7 +468,21 @@ class dynamic_reference : public dynamic_reference_base
this->invalid = false;
this->ref = NULL;
}
- return this->ref;
+ return this->ref != NULL;
+ }
+
+ virtual inline operator T*()
+ {
+ if (this->operator bool())
+ return this->ref;
+ return NULL;
+ }
+
+ virtual inline T *operator->()
+ {
+ if (this->operator bool())
+ return this->ref;
+ return NULL;
}
virtual inline void operator=(T *newref)
@@ -484,16 +498,6 @@ class dynamic_reference : public dynamic_reference_base
if (this->ref)
this->ref->AddReference(this);
}
-
- virtual inline T *operator->()
- {
- return this->ref;
- }
-
- virtual inline T *operator*()
- {
- return this->ref;
- }
};
#endif // ANOPE_H
diff --git a/include/bots.h b/include/bots.h
index bcbbc83d7..7316f074e 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -90,6 +90,12 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
* @param reason The reason we're parting
*/
void Part(Channel *c, const Anope::string &reason = "");
+
+ /** Called when a user messages this bot
+ * @param u The user
+ * @param message The users' message
+ */
+ virtual void OnMessage(User *u, const Anope::string &message);
};
#endif // BOTS_H
diff --git a/include/channels.h b/include/channels.h
index d0f899794..5d18a381f 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -12,38 +12,9 @@
typedef Anope::insensitive_map<Channel *> channel_map;
extern CoreExport channel_map ChannelList;
-struct UserData
-{
- UserData()
- {
- Clear();
- }
-
- virtual ~UserData() { }
-
- void Clear()
- {
- last_use = last_start = Anope::CurTime;
- lines = times = 0;
- lastline.clear();
- }
-
- /* Data validity */
- time_t last_use;
-
- /* for flood kicker */
- int16 lines;
- time_t last_start;
-
- /* for repeat kicker */
- Anope::string lastline;
- int16 times;
-};
-
-struct UserContainer
+struct UserContainer : public Extensible
{
User *user;
- UserData ud;
ChannelStatus *Status;
UserContainer(User *u) : user(u) { }
@@ -93,8 +64,6 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlag, 3>
Anope::string topic_setter; /* Who set the topic */
time_t topic_time; /* When the topic was set*/
- std::list<BanData *> bd;
-
time_t server_modetime; /* Time of last server MODE */
time_t chanserv_modetime; /* Time of last check_modes() */
int16 server_modecount; /* Number of server MODEs this second */
diff --git a/include/config.h b/include/config.h
index 5cba79587..666649253 100644
--- a/include/config.h
+++ b/include/config.h
@@ -167,7 +167,7 @@ template<> class ValueContainer<char **> : public ValueContainerBase
return;
}
*val = new char[s];
- strlcpy(*val, newval, s);
+ memcpy(*val, newval, s);
}
};
@@ -264,7 +264,6 @@ bool ValidateHostServ(ServerConfig *config, const Anope::string &tag, const Anop
bool ValidateLimitSessions(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
-bool ValidateDefCon(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
bool ValidateNickLen(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
bool ValidateMail(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
bool ValidateGlobalOnCycle(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
@@ -435,7 +434,7 @@ class CoreExport ServerConfig
/* OperServ name */
Anope::string s_OperServ;
/* Global name */
- Anope::string s_GlobalNoticer;
+ Anope::string s_Global;
/* NickServs realname */
Anope::string desc_NickServ;
/* ChanServ realname */
@@ -447,18 +446,26 @@ class CoreExport ServerConfig
/* OperServ realname */
Anope::string desc_OperServ;
/* Global realname */
- Anope::string desc_GlobalNoticer;
+ Anope::string desc_Global;
/* HostServ Name */
Anope::string s_HostServ;
/* HostServ realname */
Anope::string desc_HostServ;
+ /* Core HostServ modules */
+ Anope::string HostCoreModules;
/* Filename for the PID file */
Anope::string PIDFilename;
/* MOTD filename */
Anope::string MOTDFilename;
+ /* Core MemoServ Modules */
+ Anope::string MemoCoreModules;
+ /* Core OperServ Modules */
+ Anope::string OperCoreModules;
+ /* Core Global Modules */
+ Anope::string GlobalCoreModules;
/* True if its ok to not be able to save backs */
bool NoBackupOkay;
/* Do password checking when new people register */
@@ -578,6 +585,8 @@ class CoreExport ServerConfig
bool NSStrictPrivileges;
/* Use email to verify new users registering */
bool NSEmailReg;
+ /* Core NickServ modules */
+ Anope::string NickCoreModules;
/* Set the proper channel modes on users when they identify */
bool NSModeOnID;
/* Add the users hostnask their access list when they register */
@@ -585,6 +594,8 @@ class CoreExport ServerConfig
/* Maximum number of channels on AJoin */
unsigned AJoinMax;
+ /* Core ChanServ modules */
+ Anope::string ChanCoreModules;
/* Default flags for newly registered channels */
Flags<ChannelInfoFlag, CI_END> CSDefFlags;
/* Max number of channels a user can own */
@@ -621,7 +632,9 @@ class CoreExport ServerConfig
/* Who can use memos reciepts */
unsigned MSMemoReceipt;
- /* Defai;t BotServ flags */
+ /* Core BotServ modules */
+ Anope::string BotCoreModules;
+ /* Default BotServ flags */
Flags<BotServFlag> BSDefFlags;
/* How long before botserv forgets a user. This is used for flood kickers etc */
time_t BSKeepData;
@@ -710,39 +723,6 @@ class CoreExport ServerConfig
std::list<Anope::string> EncModuleList;
/* Database modules */
std::list<Anope::string> DBModuleList;
- /* HostServ Core Modules */
- std::list<Anope::string> HostServCoreModules;
- /* MemoServ Core Modules */
- std::list<Anope::string> MemoServCoreModules;
- /* BotServ Core Modules */
- std::list<Anope::string> BotServCoreModules;
- /* OperServ Core Modules */
- std::list<Anope::string> OperServCoreModules;
- /* NickServ Core Modules */
- std::list<Anope::string> NickServCoreModules;
- /* ChanServ Core Modules */
- std::list<Anope::string> ChanServCoreModules;
-
- /* Default defcon level */
- int DefConLevel;
- /* Timeout before defcon is reset */
- time_t DefConTimeOut;
- /* Session limiit to use when using defcon */
- unsigned DefConSessionLimit;
- /* How long to add akills for defcon */
- time_t DefConAKILL;
- /* Chan modes for defcon */
- Anope::string DefConChanModes;
- /* Should we global on defcon */
- bool GlobalOnDefcon;
- /* Should we send DefconMessage aswell? */
- bool GlobalOnDefconMore;
- /* Message to send when defcon is off */
- Anope::string DefConOffMessage;
- /* Message to send when defcon is on*/
- Anope::string DefconMessage;
- /* Reason to akill clients for defcon */
- Anope::string DefConAkillReason;
/* The socket engine in use */
Anope::string SocketEngine;
diff --git a/include/extern.h b/include/extern.h
index 0b29c0d03..6ec3310e9 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -31,35 +31,15 @@ E void kill_user(const Anope::string &source, User *user, const Anope::string &r
E bool bad_password(User *u);
E void common_unban(ChannelInfo *ci, User *u, bool full = false);
-E BotInfo *BotServ;
-E BotInfo *ChanServ;
-E BotInfo *Global;
-E BotInfo *HostServ;
-E BotInfo *MemoServ;
-E BotInfo *NickServ;
-E BotInfo *OperServ;
-
/**** botserv.c ****/
-E void get_botserv_stats(long *nrec, long *memuse);
-E void bs_init();
-E void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf);
E BotInfo *findbot(const Anope::string &nick);
-/** Finds a pseudoclient, given a UID. Useful for TS6 protocol modules.
- * @param uid The UID to search for
- * @return The pseudoclient structure, or NULL if one could not be found
- */
-E Anope::string normalizeBuffer(const Anope::string &);
-
-E void check_ban(ChannelInfo *ci, User *u, int ttbtype);
-E void bot_kick(ChannelInfo *ci, User *u, const char *message, ...);
E void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
E void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
/**** channels.c ****/
-E void get_channel_stats(long *nrec, long *memuse);
E Channel *findchan(const Anope::string &chan);
@@ -75,27 +55,14 @@ E void MassChannelModes(BotInfo *bi, const Anope::string &modes);
E void chan_set_correct_modes(User *user, Channel *c, int give_modes);
-inline BotInfo *whosends(ChannelInfo *ci)
-{
- if (!ci || !ci->bi || !ci->c || !ci->botflags.HasFlag(BS_SYMBIOSIS) || !ci->c->FindUser(ci->bi))
- return ChanServ ? ChanServ : NickServ;
- return ci->bi;
-}
-
/**** chanserv.c ****/
E LevelInfo levelinfo[];
-E void get_chanserv_stats(long *nrec, long *memuse);
E void reset_levels(ChannelInfo *ci);
-E void cs_init();
-E void expire_chans();
-E void cs_remove_nick(NickCore *nc);
E void check_modes(Channel *c);
-E int check_valid_admin(User *user, Channel *chan, int servermode);
-E int check_valid_op(User *user, Channel *chan, int servermode);
E ChannelInfo *cs_findchan(const Anope::string &chan);
E int check_access(User *user, ChannelInfo *ci, int what);
@@ -111,17 +78,11 @@ E Anope::string get_mlock_modes(ChannelInfo *ci, int complete);
E ConfigurationFile services_conf;
E ServerConfig *Config;
-/* hostserv.c */
-E void do_on_id(User *u);
-E void HostServSyncVhosts(NickAlias *na);
-
/**** encrypt.c ****/
E int enc_encrypt(const Anope::string &src, Anope::string &dest);
E int enc_decrypt(const Anope::string &src, Anope::string &dest);
/**** hostserv.c ****/
-E void get_hostserv_stats(long *nrec, long *memuse);
-E void hostserv_init();
/**** init.c ****/
@@ -146,9 +107,6 @@ E void PopLanguage();
E const char *anope_gettext(const char *string);
E void SyntaxError(CommandSource &source, const Anope::string &command, const Anope::string &message);
-/*** logger.cpp ***/
-E void InitLogChannels(ServerConfig *);
-
/**** main.c ****/
E Anope::string services_dir;
@@ -169,7 +127,6 @@ E time_t start_time;
E ConnectionSocket *UplinkSock;
E void save_databases();
-E void expire_all();
E void sighandler(int signum);
E void do_restart_services();
@@ -184,14 +141,6 @@ class CoreExport UplinkSocket : public ConnectionSocket
bool Read(const Anope::string &buf);
};
-/**** memoserv.c ****/
-
-E void ms_init();
-E void rsend_notify(CommandSource &source, Memo *m, const Anope::string &chan);
-E void check_memos(User *u);
-E MemoInfo *getmemoinfo(const Anope::string &name, bool &ischan, bool &isforbid);
-E void memo_send(CommandSource &source, const Anope::string &name, const Anope::string &text, int z);
-
/**** messages.cpp ****/
E void init_core_messages();
@@ -225,12 +174,6 @@ E bool OnError(const Anope::string &, const std::vector<Anope::string> &);
E bool IsFile(const Anope::string &filename);
E int toupper(char);
E int tolower(char);
-#ifndef HAVE_STRLCPY
-E size_t strlcpy(char *, const char *, size_t);
-#endif
-#ifndef HAVE_STRLCAT
-E size_t strlcat(char *, const char *, size_t);
-#endif
E time_t dotime(const Anope::string &s);
E Anope::string duration(time_t seconds);
@@ -260,6 +203,7 @@ E std::vector<Anope::string> BuildStringVector(const Anope::string &, char = ' '
E bool str_is_wildcard(const Anope::string &str);
E bool str_is_pure_wildcard(const Anope::string &str);
+E Anope::string normalizeBuffer(const Anope::string &);
/**** modes.cpp ****/
/* Number of generic modes we support */
@@ -269,15 +213,9 @@ E void SetDefaultMLock(ServerConfig *config);
/**** nickserv.c ****/
-E void get_aliases_stats(long &count, long &mem);
-E void get_core_stats(long &count, long &mem);
E void change_core_display(NickCore *nc);
E void change_core_display(NickCore *nc, const Anope::string &newdisplay);
-E int do_setmodes(User *u);
-E void ns_init();
-E int validate_user(User *u);
-E void expire_nicks();
E NickAlias *findnick(const Anope::string &nick);
E NickCore *findcore(const Anope::string &nick);
E bool is_on_access(const User *u, const NickCore *nc);
@@ -292,24 +230,6 @@ E void send_cmd(const Anope::string &source, const char *fmt, ...) FORMAT(printf
E void notice_server(const Anope::string &source, const Server *s, const char *fmt, ...) FORMAT(printf, 3, 4);
-/**** sessions.c ****/
-
-E std::vector<Exception *> exceptions;
-
-E void get_session_stats(long &count, long &mem);
-E void get_exception_stats(long &count, long &mem);
-
-E void add_session(User *u);
-E void del_session(User *u);
-
-E void expire_exceptions();
-
-E Session *findsession(const Anope::string &host);
-
-E Exception *find_host_exception(const Anope::string &host);
-E Exception *find_hostip_exception(const Anope::string &host, const Anope::string &hostip);
-E int exception_add(User *u, const Anope::string &mask, unsigned limit, const Anope::string &reason, const Anope::string &who, time_t expires);
-
/**** sockets.cpp ****/
E SocketEngineBase *SocketEngine;
@@ -323,8 +243,6 @@ E int32 opcnt;
E uint32 maxusercnt, usercnt;
E time_t maxusertime;
-E void get_user_stats(long &count, long &mem);
-
E User *finduser(const Anope::string &nick);
E User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes);
@@ -342,9 +260,4 @@ E Anope::string create_mask(User *u);
E void b64_encode(const Anope::string &src, Anope::string &target);
E void b64_decode(const Anope::string &src, Anope::string &target);
-#ifdef _WIN32
-E Anope::string GetWindowsVersion();
-E bool SupportedWindowsVersion();
-#endif
-
#endif /* EXTERN_H */
diff --git a/include/logger.h b/include/logger.h
index 6d134c227..cb3d00d6a 100644
--- a/include/logger.h
+++ b/include/logger.h
@@ -39,7 +39,7 @@ class CoreExport Log
std::stringstream buf;
- Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = Global);
+ Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = NULL);
/* LOG_COMMAND/OVERRIDE/ADMIN */
Log(LogType type, User *u, Command *c, ChannelInfo *ci = NULL);
diff --git a/include/modules.h b/include/modules.h
index 51a550316..badb59616 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -314,9 +314,8 @@ class CoreExport Module : public Extensible
virtual void OnUserKicked(Channel *c, User *target, const Anope::string &source, const Anope::string &kickmsg) { }
/** Called when Services' configuration has been loaded.
- * @param startup True if Services is starting for the first time, false otherwise.
*/
- virtual void OnReload(bool startup) {}
+ virtual void OnReload() { }
/** Called before a bot is assigned to a channel.
* @param sender The user assigning the bot
@@ -333,20 +332,11 @@ class CoreExport Module : public Extensible
*/
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci) { return EVENT_CONTINUE; }
- /** Called after a user has been introduced, but before any type
- * of checking has been done (akills, defcon, s*lines, etc)
- * return EVENT_STOP here to allow the user to get by untouched,
- * or kill them then return EVENT_STOP to tell Anope the user no
- * longer exists
- * @param u The user
- * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing
- */
- virtual EventReturn OnPreUserConnect(User *u) { return EVENT_CONTINUE; }
-
/** Called when a new user connects to the network.
* @param u The connecting user.
+ * @param exempt set to true/is true if the user should be excepted from bans etc
*/
- virtual void OnUserConnect(User *u) { }
+ virtual void OnUserConnect(dynamic_reference<User> &u, bool &exempt) { }
/** Called when a new server connects to the network.
* @param s The server that has connected to the network
@@ -523,16 +513,6 @@ class CoreExport Module : public Extensible
*/
virtual void OnServerDisconnect() { }
- /** Called before the database expire routines are called
- * Note: Code that is in seperate expiry routines should just be done
- * when we save the DB, theres no need to have both
- */
- virtual void OnPreDatabaseExpire() { }
-
- /** Called when the database expire routines are called
- */
- virtual void OnDatabaseExpire() { }
-
/** Called when the flatfile dbs are being written
* @param Write A callback to the function used to insert a line into the database
*/
@@ -639,11 +619,10 @@ class CoreExport Module : public Extensible
virtual void OnDefconLevel(int level) { }
/** Called before an akill is added
- * @param u The user adding the akill
* @param ak The akill
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnAddAkill(User *u, XLine *ak) { return EVENT_CONTINUE; }
+ virtual EventReturn OnAddAkill(XLine *ak) { return EVENT_CONTINUE; }
/** Called before an akill is deleted
* @param u The user removing the akill
@@ -652,11 +631,10 @@ class CoreExport Module : public Extensible
virtual void OnDelAkill(User *u, XLine *ak) { }
/** Called after an exception has been added
- * @param u The user who added it
* @param ex The exception
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnExceptionAdd(User *u, Exception *ex) { return EVENT_CONTINUE; }
+ virtual EventReturn OnExceptionAdd(Exception *ex) { return EVENT_CONTINUE; }
/** Called before an exception is deleted
* @param u The user who is deleting it
@@ -665,12 +643,11 @@ class CoreExport Module : public Extensible
virtual void OnExceptionDel(User *u, Exception *ex) { }
/** Called before a XLine is added
- * @param u The user adding the XLine
* @param sx The XLine
* @param Type The type of XLine this is
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnAddXLine(User *u, XLine *x, XLineType Type) { return EVENT_CONTINUE; }
+ virtual EventReturn OnAddXLine(XLine *x, XLineType Type) { return EVENT_CONTINUE; }
/** Called before a XLine is deleted
* @param u The user deleting the XLine
@@ -932,12 +909,22 @@ class CoreExport Module : public Extensible
*/
virtual EventReturn OnCheckAuthentication(User *u, Command *c, const std::vector<Anope::string> &params, const Anope::string &account, const Anope::string &password) { return EVENT_CONTINUE; }
+ /** Called when a user does /ns update
+ * @param u The user
+ */
+ virtual void OnNickUpdate(User *u) { }
+
/** Called when we get informed about a users SSL fingerprint
* when we call this, the fingerprint should already be stored in the user struct
* @param u pointer to the user
*/
virtual void OnFingerprint(User *u) { }
+ /** Called when a user becomes (un)away
+ * @param message The message, is .empty() if unaway
+ */
+ virtual void OnUserAway(User *u, const Anope::string &message) { }
+
/** Called when a vhost is deleted
* @param na The nickalias of the vhost
*/
@@ -949,18 +936,12 @@ class CoreExport Module : public Extensible
virtual void OnSetVhost(NickAlias *na) { }
/** Called when a memo is sent
- * @param u The user sending the memo
- * @param nc The nickcore of who the memo was sent to
- * @param m The memo
- */
- virtual void OnMemoSend(User *u, NickCore *nc, Memo *m) { }
-
- /** Called when a memo is sent
- * @param u The user sending the memo
- * @param ci The channel the memo was sent to
+ * @param source The source of the memo
+ * @param target The target of the memo
+ * @param mi Memo info for target
* @param m The memo
*/
- virtual void OnMemoSend(User *u, ChannelInfo *ci, Memo *m) { }
+ virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) { }
/** Called when a memo is deleted
* @param nc The nickcore of the memo being deleted
@@ -1064,10 +1045,8 @@ class CoreExport Module : public Extensible
* @param u The source of the message
* @param ci The channel
* @param msg The message
- * @param Allow set to false to make the flood kickers halt
- * @return MOD_STOP to stop processing completely
*/
- virtual EventReturn OnPrivmsg(User *u, ChannelInfo *ci, Anope::string &msg, bool &Allow) { return EVENT_CONTINUE; }
+ virtual void OnPrivmsg(User *u, ChannelInfo *ci, Anope::string &msg) { }
/** Called when any object is destroyed
* @param b The object
@@ -1087,6 +1066,7 @@ enum Implementation
I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess,
I_OnNickClearCert, I_OnNickAddCert, I_OnNickEraseCert,
I_OnNickInfo, I_OnFindNick, I_OnFindCore, I_OnCheckAuthentication,
+ I_OnNickUpdate,
/* ChanServ */
I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange,
@@ -1105,8 +1085,8 @@ enum Implementation
I_OnMemoSend, I_OnMemoDel,
/* Users */
- I_OnPreUserConnect, I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnUserLogoff, I_OnPreJoinChannel,
- I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, I_OnFingerprint,
+ I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnUserLogoff, I_OnPreJoinChannel,
+ I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, I_OnFingerprint, I_OnUserAway,
/* OperServ */
I_OnDefconLevel, I_OnAddAkill, I_OnDelAkill, I_OnExceptionAdd, I_OnExceptionDel,
@@ -1114,7 +1094,6 @@ enum Implementation
/* Database */
I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnLoadDatabase,
- I_OnDatabaseExpire,
I_OnDatabaseWrite, I_OnDatabaseRead, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata,
/* Modules */
@@ -1122,7 +1101,7 @@ enum Implementation
/* Other */
I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnPreUplinkSync, I_OnServerDisconnect, I_OnPreCommandRun,
- I_OnPreCommand, I_OnPostCommand, I_OnPreDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal,
+ I_OnPreCommand, I_OnPostCommand, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal,
I_OnServerQuit, I_OnTopicUpdated,
I_OnEncrypt, I_OnDecrypt,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
@@ -1293,10 +1272,6 @@ class service_reference : public dynamic_reference<T>
{
}
- virtual ~service_reference()
- {
- }
-
operator bool()
{
if (this->invalid)
diff --git a/include/operserv.h b/include/oper.h
index f039b6107..cebd079ca 100644
--- a/include/operserv.h
+++ b/include/oper.h
@@ -6,15 +6,10 @@
* Please read COPYING and README for further details.
*/
-#ifndef OPERSERV_H
-#define OPERSERV_H
+#ifndef OPER_H
+#define OPER_H
extern CoreExport std::vector<NewsItem *> News;
-extern CoreExport std::vector<std::bitset<32> > DefCon;
-extern CoreExport bool DefConModesSet;
-extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOn;
-extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOff;
-extern CoreExport std::map<ChannelModeName, Anope::string> DefConModesOnParams;
class XLineManager;
extern CoreExport XLineManager *SGLine;
@@ -22,19 +17,6 @@ extern CoreExport XLineManager *SZLine;
extern CoreExport XLineManager *SQLine;
extern CoreExport XLineManager *SNLine;
-extern CoreExport bool SetDefConParam(ChannelModeName, const Anope::string &);
-extern CoreExport bool GetDefConParam(ChannelModeName, Anope::string &);
-extern CoreExport void UnsetDefConParam(ChannelModeName);
-extern CoreExport bool CheckDefCon(DefconLevel Level);
-extern CoreExport bool CheckDefCon(int level, DefconLevel Level);
-extern CoreExport void AddDefCon(int level, DefconLevel Level);
-extern CoreExport void DelDefCon(int level, DefconLevel Level);
-
-extern CoreExport void os_init();
-
-extern CoreExport void oper_global(const Anope::string &nick, const char *fmt, ...);
-extern CoreExport void server_global(const Server *s, const Anope::string &message);
-
enum XLineType
{
X_SNLINE,
@@ -129,14 +111,13 @@ class CoreExport XLineManager
void Clear();
/** Add an entry to this XLine Manager
- * @param bi The bot error replies should be sent from
- * @param u The user adding the XLine
* @param mask The mask of the XLine
+ * @param creator The creator of the XLine
* @param expires When this should expire
* @param reaosn The reason
* @return A pointer to the XLine
*/
- virtual XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ virtual XLine *Add(const Anope::string &mask, const Anope::string &creator, time_t expires, const Anope::string &reason);
private:
/** Delete an XLine, eg, remove it from the IRCd.
@@ -190,7 +171,7 @@ class CoreExport XLineManager
class SGLineManager : public XLineManager
{
public:
- XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ XLine *Add(const Anope::string &mask, const Anope::string &creator, time_t expires, const Anope::string &reason);
void Del(XLine *x);
@@ -204,7 +185,7 @@ class SGLineManager : public XLineManager
class SNLineManager : public XLineManager
{
public:
- XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ XLine *Add(const Anope::string &mask, const Anope::string &creator, time_t expires, const Anope::string &reason);
void Del(XLine *x);
@@ -220,7 +201,7 @@ class SNLineManager : public XLineManager
class SQLineManager : public XLineManager
{
public:
- XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ XLine *Add(const Anope::string &mask, const Anope::string &creator, time_t expires, const Anope::string &reason);
void Del(XLine *x);
@@ -236,7 +217,7 @@ class SQLineManager : public XLineManager
class SZLineManager : public XLineManager
{
public:
- XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ XLine *Add(const Anope::string &mask, const Anope::string &creator, time_t expires, const Anope::string &reason);
void Del(XLine *x);
@@ -247,4 +228,4 @@ class SZLineManager : public XLineManager
void Send(User *u, XLine *x);
};
-#endif // OPERSERV_H
+#endif // OPER_H
diff --git a/include/regchannel.h b/include/regchannel.h
index 6f9a52fdc..a3112cfbc 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -175,6 +175,11 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
int16 floodlines, floodsecs; /* For FLOOD kicker */
int16 repeattimes; /* For REPEAT kicker */
+ /** Find which bot should send mode/topic/etc changes for this channel
+ * @return The bot
+ */
+ BotInfo *WhoSends();
+
/** Add an entry to the channel access list
*
* @param mask The mask of the access entry
diff --git a/include/services.h b/include/services.h
index 6caa06d48..2974465a4 100644
--- a/include/services.h
+++ b/include/services.h
@@ -272,6 +272,7 @@ template<typename T, size_t Size = 32> class Flags
const Anope::string *Flag_Strings;
public:
+ Flags() : Flag_Strings(NULL) { }
Flags(const Anope::string *flag_strings) : Flag_Strings(flag_strings) { }
/** Add a flag to this item
@@ -409,7 +410,6 @@ class ChannelInfo;
class Channel;
class Server;
class Entry;
-struct Session;
#include "threadengine.h"
#include "opertype.h"
@@ -454,13 +454,11 @@ enum MemoFlag
/* Memo is unread */
MF_UNREAD,
/* Sender requests a receipt */
- MF_RECEIPT,
- /* Memo is a notification of receipt */
- MF_NOTIFYS
+ MF_RECEIPT
};
const Anope::string MemoFlagStrings[] = {
- "MF_UNREAD", "MF_RECEIPT", "MF_NOTIFYS", ""
+ "MF_UNREAD", "MF_RECEIPT", ""
};
/* Memo info structures. Since both nicknames and channels can have memos,
@@ -486,6 +484,23 @@ struct CoreExport MemoInfo
bool HasIgnore(User *u);
};
+struct Session
+{
+ Anope::string host; /* Host of the session */
+ unsigned count; /* Number of clients with this host */
+ unsigned hits; /* Number of subsequent kills for a host */
+};
+
+struct Exception
+{
+ Anope::string mask; /* Hosts to which this exception applies */
+ unsigned limit; /* Session limit for exception */
+ Anope::string who; /* Nick of person who added the exception */
+ Anope::string reason; /* Reason for exception's addition */
+ time_t time; /* When this exception was added */
+ time_t expires; /* Time when it expires. 0 == no expiry */
+};
+
/*************************************************************************/
class CoreExport HostInfo
@@ -703,13 +718,6 @@ enum
#include "account.h"
#include "bots.h"
-struct BanData
-{
- Anope::string mask; /* Since a nick is unsure and a User structure is unsafe */
- time_t last_use; /* Since time is the only way to check whether it's still useful */
- int16 ttb[TTB_SIZE];
-};
-
struct LevelInfo
{
int what;
@@ -801,43 +809,7 @@ struct MailInfo
/*************************************************************************/
-struct Exception
-{
- Anope::string mask; /* Hosts to which this exception applies */
- unsigned limit; /* Session limit for exception */
- Anope::string who; /* Nick of person who added the exception */
- Anope::string reason; /* Reason for exception's addition */
- time_t time; /* When this exception was added */
- time_t expires; /* Time when it expires. 0 == no expiry */
-};
-
-/*************************************************************************/
-
-extern CoreExport Anope::map<Session *> SessionList;
-
-struct Session
-{
- Anope::string host;
- unsigned count; /* Number of clients with this host */
- unsigned hits; /* Number of subsequent kills for a host */
-};
-
-/*************************************************************************/
-
/* 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
-};
/*************************************************************************/
@@ -863,7 +835,7 @@ class ConfigurationFile;
#include "extern.h"
#include "language.h"
-#include "operserv.h"
+#include "oper.h"
#include "mail.h"
#include "servers.h"
#include "logger.h"
diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake
index 78150a82d..68f3f74e6 100644
--- a/include/sysconf.h.cmake
+++ b/include/sysconf.h.cmake
@@ -12,8 +12,6 @@
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE_STRICMP 1
#cmakedefine HAVE_STRINGS_H 1
-#cmakedefine HAVE_STRLCAT 1
-#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_UMASK 1
#cmakedefine HAVE_EVENTFD 1
#cmakedefine GETTEXT_FOUND 1