From cb77b70cbdffdc95612ef951a951fedf14559f27 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 12 Apr 2005 14:38:32 +0000 Subject: Added Server::PseudoToUser and Server::UserToPseudo git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1057 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/modules.h') diff --git a/include/modules.h b/include/modules.h index a040757f6..34549b6c2 100644 --- a/include/modules.h +++ b/include/modules.h @@ -96,6 +96,8 @@ typedef std::deque chanuserlist; // ********************************************************************************************* +#define FD_MAGIC_NUMBER -42 + extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); extern void server_mode(char **parameters, int pcnt, userrec *user); @@ -667,6 +669,22 @@ class Server : public classbase */ virtual chanuserlist GetUsers(chanrec* chan); + /** 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,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::ZombifyUser, 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,std::string message); + }; #define CONF_NOT_A_NUMBER 0x000010 -- cgit v1.2.3