public:
UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt);
- void OnLookupComplete(const std::string &result);
+ void OnLookupComplete(const std::string &result, unsigned int ttl);
void OnError(ResolverError e, const std::string &errormessage);
};
/** Number of channels this user is currently on
*/
unsigned int ChannelCount;
+
+ char* cached_fullhost;
+ char* cached_hostip;
+ char* cached_makehost;
+ char* cached_fullrealhost;
+
+ /** When we erase the user (in the destructor),
+ * we call this method to subtract one from all
+ * mode characters this user is making use of.
+ */
+ void DecrementModes();
public:
/** Resolvers for looking up this users IP address
* This will occur if and when res_reverse completes.
*/
int flood;
- /** Number of seconds this user is given to send USER/NICK
- * If they do not send their details in this time limit they
- * will be disconnected
+ /** Timestamp of current time + connection class timeout.
+ * This user must send USER/NICK before this timestamp is
+ * reached or they will be disconnected.
*/
- unsigned int timeout;
+ time_t timeout;
/** The oper type they logged in as, if they are an oper.
* This is used to check permissions in operclasses, so that
*/
virtual char* GetFullRealHost();
+ /** This clears any cached results that are used for GetFullRealHost() etc.
+ * The results of these calls are cached as generating them can be generally expensive.
+ */
+ void InvalidateCache();
+
/** Create a displayable mode string for this users snomasks
* @return The notice mask character sequence
*/
/** Sets of time and users in whowas list
*/
- typedef std::map<time_t,irc::string> whowas_users_fifo;
+ typedef std::deque<std::pair<time_t,irc::string> > whowas_users_fifo;
/** Called every hour by the core to remove expired entries
*/