++out;
quotient /= 10;
}
- if ( in < 0)
+ if (in < 0)
*out++ = '-';
*out = 0;
std::reverse(res,out);
return ConvNumeric(in);
}
-/** Template function to convert any input type to std::string
- */
-inline std::string ConvToStr(const unsigned long in)
-{
- return ConvNumeric(in);
-}
-
/** Template function to convert any input type to std::string
*/
inline std::string ConvToStr(const char* in)
/* Forward declaration - required */
class XLineManager;
+class BanCacheManager;
/** The main class of the irc server.
* This class contains instances of all the other classes
*/
bool DaemonSeed();
- /** Iterate the list of InspSocket objects, removing ones which have timed out
+ /** Iterate the list of BufferedSocket objects, removing ones which have timed out
* @param TIME the current time
*/
void DoSocketTimeouts(time_t TIME);
void InitialiseUID();
/** Perform background user events such as PING checks
- * @param TIME the current time
*/
- void DoBackgroundUserStuff(time_t TIME);
+ void DoBackgroundUserStuff();
/** Returns true when all modules have done pre-registration checks on a user
* @param user The user to verify
FindDescriptorHandler HandleFindDescriptor;
FloodQuitUserHandler HandleFloodQuitUser;
- /** InspSocket classes pending deletion after being closed.
+ /** BufferedSocket classes pending deletion after being closed.
* We don't delete these immediately as this may cause a segmentation fault.
*/
- std::map<InspSocket*,InspSocket*> SocketCull;
+ std::map<BufferedSocket*,BufferedSocket*> SocketCull;
/** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1
* Reason for it:
*/
ModuleManager* Modules;
+ /** BanCacheManager is used to speed up checking of restrictions on connection
+ * to the IRCd.
+ */
+ BanCacheManager *BanCache;
+
/** Stats class, holds miscellaneous stats counters
*/
serverstats* stats;
*/
XLineManager* XLines;
- /** The time we next call our ping timeout and reg timeout checks
- */
- time_t next_call;
-
/** Set to the current signal recieved
*/
int s_signal;
*/
int RegisteredUserCount();
- /** Return a count of invisible (umode +i) users only
- * @return The number of invisible users
- */
- int InvisibleUserCount();
-
/** Return a count of opered (umode +o) users only
* @return The number of opers
*/
/** Add a new mode to this server's mode parser
* @param mh The modehandler to add
- * @param modechar The mode character this modehandler handles
* @return True if the mode handler was added
*/
- bool AddMode(ModeHandler* mh, const unsigned char modechar);
+ bool AddMode(ModeHandler* mh);
/** Add a new mode watcher to this server's mode parser
* @param mw The modewatcher to add
*/
bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
- /** Add a gline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddGLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Add a qline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param nickname The nickmask to set the line against
- */
- void AddQLine(long duration, const std::string &source, const std::string &reason, const std::string &nickname);
-
- /** Add a zline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param ipaddr The ip-mask to set the line against
- */
- void AddZLine(long duration, const std::string &source, const std::string &reason, const std::string &ipaddr);
-
- /** Add a kline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddKLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Add an eline
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddELine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Delete a gline
- * @param hostmask The gline to delete
- * @return True if the item was removed
- */
- bool DelGLine(const std::string &hostmask);
-
- /** Delete a qline
- * @param nickname The qline to delete
- * @return True if the item was removed
- */
- bool DelQLine(const std::string &nickname);
-
- /** Delete a zline
- * @param ipaddr The zline to delete
- * @return True if the item was removed
- */
- bool DelZLine(const std::string &ipaddr);
-
- /** Delete a kline
- * @param hostmask The kline to delete
- * @return True if the item was removed
- */
- bool DelKLine(const std::string &hostmask);
-
- /** Delete an eline
- * @param hostmask The kline to delete
- * @return True if the item was removed
- */
- bool DelELine(const std::string &hostmask);
-
/** Return true if the given parameter is a valid nick!user\@host mask
* @param mask A nick!user\@host masak to match against
* @return True i the mask is valid
*/
int Run();
- /** Force all InspSockets to be removed which are due to
+ /** Force all BufferedSockets to be removed which are due to
* be culled.
*/
- void InspSocketCull();
+ void BufferedSocketCull();
char* GetReadBuffer()
{