diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/helperfuncs.h | 15 | ||||
-rw-r--r-- | include/inspircd.h | 23 | ||||
-rw-r--r-- | include/modules.h | 37 | ||||
-rw-r--r-- | include/users.h | 2 |
4 files changed, 24 insertions, 53 deletions
diff --git a/include/helperfuncs.h b/include/helperfuncs.h index b4089fa18..801e05bdb 100644 --- a/include/helperfuncs.h +++ b/include/helperfuncs.h @@ -52,30 +52,17 @@ void WriteOpers(const char* text, ...); void WriteOpers_NoFormat(const char* text); std::string GetServerDescription(const char* servername); -void WriteMode(const char* modes, int flags, const char* text, ...); -void NoticeAll(userrec *source, bool local_only, char* text, ...); -void ServerNoticeAll(char* text, ...); -void ServerPrivmsgAll(char* text, ...); void strlower(char *n); userrec* Find(const std::string &nick); userrec* Find(const char* nick); chanrec* FindChan(const char* chan); +int usercount_i(chanrec *c); long GetMaxBans(char* name); void purge_empty_chans(userrec* u); char* chanmodes(chanrec *chan, bool showkey); void userlist(userrec *user,chanrec *c); -int usercount_i(chanrec *c); -int usercount(chanrec *c); ConnectClass GetClass(userrec *user); -void send_error(char *s); void Error(int status); -int usercnt(void); -int registered_usercount(void); -int usercount_invisible(void); -int usercount_opers(void); -int usercount_unknown(void); -long chancount(void); -long local_count(); void ShowMOTD(userrec *user); void ShowRULES(userrec *user); bool AllModulesReportReady(userrec* user); diff --git a/include/inspircd.h b/include/inspircd.h index 5aacd072d..f901200cd 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -83,6 +83,7 @@ class InspIRCd : public classbase private: char MODERR[MAXBUF]; bool expire_run; + servernamelist servernames; void EraseFactory(int j); void EraseModule(int j); @@ -111,15 +112,31 @@ class InspIRCd : public classbase std::vector<InspSocket*> module_sockets; InspSocket* socket_ref[MAX_DESCRIPTORS]; /* XXX: This should probably be made private, with inline accessors */ userrec* fd_ref_table[MAX_DESCRIPTORS]; /* XXX: Ditto */ - user_hash clientlist; /* XXX: Ditto */ - chan_hash chanlist; /* XXX: Ditto */ - servernamelist servernames; /* XXX: Ditto */ + user_hash clientlist; + chan_hash chanlist; + std::vector<userrec*> local_users; DNS* Res; void AddServerName(const std::string &servername); const char* FindServerNamePtr(const std::string &servername); bool FindServerName(const std::string &servername); + bool UserToPseudo(userrec* user, const std::string &message); + bool PseudoToUser(userrec* alive, userrec* zombie, const std::string &message); + + void ServerNoticeAll(char* text, ...); + void ServerPrivmsgAll(char* text, ...); + void WriteMode(const char* modes, int flags, const char* text, ...); + + int usercnt(); + int registered_usercount(); + int usercount_invisible(); + int usercount_opers(); + int usercount_unknown(); + long chancount(); + long local_count(); + + void SendError(const char *s); std::string GetRevision(); std::string GetVersionString(); diff --git a/include/modules.h b/include/modules.h index 6104b8715..6f9ebf9e9 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1323,11 +1323,6 @@ class Server : public Extensible */ virtual bool IsNick(const std::string &nick); - /** Returns a count of the number of users on a channel. - * This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel. - */ - virtual int CountUsers(chanrec* c); - /** Adds an InspTimer which will trigger at a future time */ virtual void AddTimer(InspTimer* T); @@ -1421,21 +1416,7 @@ class Server : public Extensible */ virtual void SendMode(const char **parameters, int pcnt, userrec *user); - - /** Sends to all users matching a mode mask - * You must specify one or more usermodes as the first parameter. These can be RFC specified modes such as +i, - * or module provided modes, including ones provided by your own module. - * In the second parameter you must place a flag value which indicates wether the modes you have given will be - * logically ANDed or OR'ed. You may use one of either WM_AND or WM_OR. - * for example, if you were to use: - * - * Serv->SendToModeMask("xi", WM_OR, "m00"); - * - * Then the text 'm00' will be sent to all users with EITHER mode x or i. Conversely if you used WM_AND, the - * user must have both modes set to receive the message. - */ - virtual void SendToModeMask(const std::string &modes, int flags, const std::string &text); - + /** Matches text against a glob pattern. * Uses the ircd's internal matching function to match string against a globbing pattern, e.g. *!*@*.com * Returns true if the literal successfully matches the pattern, false if otherwise. @@ -1470,22 +1451,6 @@ class Server : public Extensible */ virtual bool IsUlined(const std::string &server); - /** Remove a user's connection to the irc server, but leave their client in existence in the - * user hash. When you call this function, the user's file descriptor will be replaced with the - * value of FD_MAGIC_NUMBER and their old file descriptor will be closed. This idle client will - * remain until it is restored with a valid file descriptor, or is removed from IRC by an operator - * After this call, the pointer to user will be invalid. - */ - virtual bool UserToPseudo(userrec* user, const std::string &message); - - /** This user takes one user, and switches their file descriptor with another user, so that one user - * "becomes" the other. The user in 'alive' is booted off the server with the given message. The user - * referred to by 'zombie' should have previously been locked with Server::UserToPseudo, otherwise - * stale sockets and file descriptor leaks can occur. After this call, the pointer to alive will be - * invalid, and the pointer to zombie will be equivalent in effect to the old pointer to alive. - */ - virtual bool PseudoToUser(userrec* alive, userrec* zombie, const std::string &message); - /** Adds a G-line * The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added. * The duration must be in seconds, however you can use the Server::CalcDuration method to convert diff --git a/include/users.h b/include/users.h index 42d0f7376..6e5a60b23 100644 --- a/include/users.h +++ b/include/users.h @@ -639,6 +639,8 @@ class userrec : public connection int CountChannels(); + void NoticeAll(char* text, ...); + /** Default destructor */ virtual ~userrec(); |