📄 auth.txt
字号:
being tracked, provided that they do not have the security option set.static Auth_TUser * MatchUH(const char *, const char *); Finds a user by last known user and host info. Primarily used in conjunction with MatchNick(nick, TRUE) to match users who are not currently being tracked. Will only match users without the security option set.static Auth_TUser * MatchPrefix(const char *); Combines MatchNick and MatchUH. Called when we have the whole prefix by which to identify a user.static Auth_TUser * MatchDCCCookie(void *, TF flag = FALSE); Finds the user associated with a DCC CHAT connection. If flag is TRUE, this will also match stale DCC cookies, for use in cleanup functions.void AddTracking(const char *channel); Adds channel to the list of channels we're tracking this user in. It is incorrect to call this function if chans==NULL. In this case use Auth_TUser::StartTracking.void RemTracking(const char *channel); If channel is in the list of channels in which we see this user, delete it from the list.void ChangeTracking(const char *s_nick); Replaces the IRC nickname for the user with s_nick. Used to respond to NICK messages for tracked users.void StartTracking(const char *channel, const char *s_nick); Begin tracking this user in channel under the IRC nick s_nick. This should not be called if we are already tracking this user.void FlushTracking(); Flushes the list of channels we're tracking this user in. If the security flag is set, we also forget the nickname under which we were tracking this user.static void FlushAllTracking(); Calls Auth_TUser::FlushTracking for all users we are currently tracking. Used in the event we're disconnected from IRC.TF IsTracking(const char *channel) const; If channel==NULL, returns TRUE if we are tracking at all. Otherwise, returns TRUE if channel matches the name of a channel in which we are tracking this user.void * RegisterDCC(void *cookie); Sets a DCC cookie. Returns the previous cookie. The DCC cookie is an arbitrary pointer used to identify DCC sessions. What this cookie actually contains will depend on the specific low-level IRC interface in use. We only require that it be be unique (i.e. that no two users get the same pointer) and that the same pointer (not just pointers to the same data) is used for all requests regarding the DCC session.void SetDCCStatus(TF flag); If flag is TRUE, and dcc_cookie!=NULL, set dcc_active=TRUE. This indicates we have an actual DCC CHAT connection with this user and should use it instead of NOTICE to communicate with this user. If flag is FALSE, set dcc_active=FALSE. If dcc_cookie!=NULL, we close or reject the DCC CHAT as appropriate, and set dcc_cookie=NULL.TF GetDCCStatus() const; Returns TRUE if we have an active DCC CHAT connection.void SendMessage(const char *message); Sends the text in message to the user. If there is an active DCC CHAT connection, we send it via that DCC CHAT. Otherwise, we send a NOTICE (or MSG if usemsg is TRUE). In the event that a user is no longer being tracked, the message will be sent only if security==FALSE and we can successfully verify that the user at the last known nick has the correct userhost info.class Auth_TTicket:Auth_TTicket(const char *s_nick, const char *s_user, const char *s_host, const char *channel, IRC_PCL s_chans = NULL); Constructor for Auth_TTicket. This is called whenever we see someone new (not associated with an existing user account or tracking ticket). s_nick is the IRC nickname we see for them. s_user is the IRC userid string we see for them. s_host is the hostname we see for them. If s_chans is not NULL then it is used as the list of channels we see them in. This will generally only be used during user Logout. If chans is NULL (the default) then channel is the name of the channel we see someone in. In the special case where someone sends a message to us out of the blue, we create a ticket with "boguschan" as the channel name.static void CleanStale(); If there is a "stale" ticket (one scheduled for deletion) this function calls Auth_TTicket::Delete on it.static void Delete(Auth_PTicket ticket); Deletes a tracking ticket while maintaining list integrity. This may be called on tickets in any order. NOTE that this does not do cleanup of the chans list! This is because tracking tickets are usually deleted either 1) when a user logs in, in which case the chans list is moved the the Auth_TUser entry; or 2) when the last channel in the chans list is deleted, in which case the list is already cleaned up.static void DeleteMe(Auth_PTicket s_stale); Calls Auth_TTicket::CleanStale and then marks s_stale as being "stale". This is used in place of Auth_TTicket::Delete in cases where execution is still in the middle of a function belonging to the passed ticket. I don't quite remember now why I made this static... come to think of it, I don't even remember why I made this public...static void FlushList(); This deletes all tracking tickets. Unlike Auth_TTicket::Delete, we clean up the chans list in each ticket.static Auth_TTicket * MatchNick(const char *); Finds the tracking ticket for a given nick.static inline Auth_TTicket * GetFirst(); returns the first tracking ticket in the list.static inline Auth_TTicket * GetLast(); returns the last tracking ticket in the list.inline Auth_TTicket * GetNext(); returns the next tracking ticket in the list.inline Auth_TTicket * GetPrev(); returns the previous tracking ticket in the list.const char * GetNick() const; returns the IRC nick we're tracking.const char * GetUser() const; returns the IRC userid string we see for this nick.const char * GetHost() const; returns the hostname we see for this nick.IRC_PCL GetChans(); returns the list of channels in which we are tracking this nick.void AddTracking(const char *channel); Adds channel to the list of channels in which we are tracking this nick.void RemTracking(const char *channel); If channel is in the list of channels in which we are tracking this nick, delete it from the list. If this is the only channel left in this list, Auth_TTicket::DeleteMe is called.void ChangeTracking(const char *s_nick); Changes the IRC nick we are tracking. Used to respond to NICK messages for people we are tracking.TF IsTracking(const char *channel) const; If called in a stale ticket, returns FALSE automatically. Otherwise, returns TRUE if we are tracking this person in channel.void FlushTracking(); Deletes the ticket, after flushing the list of channels. NOTE that Auth_TTicket::Delete and Auth_TTicket::DeleteMe do NOT flush the list of channels but assume instead that the calling function is doing something with them.void SendMessage(const char *message); Sends a NOTICE to the tracked user with the text contained in message.class Auth_TUHCB:Auth_TUHCB(void (*fun)(Auth_TUHCB *), const char *s_nick); Establishes a USERHOST callback handler. fun is the function to call once we have obtained the user and host info for s_nick. This object must be constructed before calling IRC_Userhost to insure that we know what to do with the USERHOST response when it arrives.static void Delete(Auth_TUHCB *); Cleanly removes an Auth_TUHCB object from the list, and destructs it.static void FlushList(); Systematically deletes all Auth_TUHCB objects.static inline Auth_TUHCB * GetFirst(); returns the first callback ticket in the list.inline Auth_TUHCB * GetNext(); returns the next callback ticket in the list.inline Auth_TUHCB * GetPrev(); returns the previous callback ticket in the list.inline const char * GetNick() const; returns the nick of the userhost query.inline const char * GetUser() const; returns the obtained IRC userid string.inline const char * GetHost() const; returns the obtained hostname.static void UHCR(const char *, const char *, const char *); Called to handle USERHOST responses. Finds an Auth_TUHCB object matching the USERHOST response's nick, assigns the obtained user and host to that object, and calls the callback function whose pointer is stored in the object.static Auth_PUHCB MatchNick(const char *); returns an Auth_TUHCB object matching the specified nick, or NULL if none exists.@(#) $Id: auth.txt,v 1.1.1.1.2.1 2004/03/17 05:36:48 lachesis Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -