#include "modules.h"
#include "configreader.h"
#include "inspstring.h"
+#include "protocol.h"
/**
* Used to define the maximum number of parameters a command may have.
DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
DEFINE_HANDLER1(FindDescriptorHandler, User*, int);
DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
+DEFINE_HANDLER1(IsChannelHandler, bool, const char*);
+DEFINE_HANDLER1(IsSIDHandler, bool, const std::string&);
+DEFINE_HANDLER1(RehashHandler, void, const std::string&);
/* Forward declaration - required */
class XLineManager;
private:
/** Holds the current UID. Used to generate the next one.
*/
- char current_uid[UUID_LENGTH + 1];
+ char current_uid[UUID_LENGTH];
/** Set up the signal handlers
*/
*/
void DoSocketTimeouts(time_t TIME);
- /** Sets up UID subsystem
+ /** Increments the current UID by one.
*/
- void InitialiseUID();
+ void IncrementUID(int pos);
/** Perform background user events such as PING checks
*/
IsIdentHandler HandleIsIdent;
FindDescriptorHandler HandleFindDescriptor;
FloodQuitUserHandler HandleFloodQuitUser;
+ IsChannelHandler HandleIsChannel;
+ IsSIDHandler HandleIsSID;
+ RehashHandler HandleRehash;
/** BufferedSocket classes pending deletion after being closed.
* We don't delete these immediately as this may cause a segmentation fault.
*/
int s_signal;
+ /** Protocol interface, overridden by server protocol modules
+ */
+ ProtocolInterface* PI;
+
/** Get the current time
* Because this only calls time() once every time around the mainloop,
* it is much faster than calling time() directly.
* @param chname A channel name to verify
* @return True if the name is valid
*/
- bool IsChannel(const char *chname);
+ caller1<bool, const char*> IsChannel;
/** Return true if str looks like a server ID
* @param string to check against
*/
- bool IsSID(const std::string &str);
+ caller1<bool, const std::string&> IsSID;
/** Rehash the local server
*/
- void Rehash();
+ caller1<void, const std::string&> Rehash;
/** Handles incoming signals after being set
* @param signal the signal recieved
*/
InspIRCd(int argc, char** argv);
- /** Output a log message to the ircd.log file
- * The text will only be output if the current loglevel
- * is less than or equal to the level you provide
- * @param level A log level from the DebugLevel enum
- * @param text Format string of to write to the log
- * @param ... Format arguments of text to write to the log
- */
- void Log(int level, const char* text, ...) CUSTOM_PRINTF(3, 4);
-
- /** Output a log message to the ircd.log file
- * The text will only be output if the current loglevel
- * is less than or equal to the level you provide
- * @param level A log level from the DebugLevel enum
- * @param text Text to write to the log
- */
- void Log(int level, const std::string &text);
-
/** Send a line of WHOIS data to a user.
* @param user user to send the line to
* @param dest user being WHOISed