*/
typedef std::multimap< std::string, KeyValList > ConfigDataHash;
+class InspIRCd;
+extern InspIRCd* ServerInstance;
+
#include "inspircd_config.h"
#include "inspircd_version.h"
+#include "extensible.h"
#include "numerics.h"
#include "uid.h"
#include "users.h"
class InspIRCd;
-DEFINE_HANDLER1(ProcessUserHandler, void, User*);
DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
*/
class CoreExport ConfigReaderThread : public Thread
{
- InspIRCd* ServerInstance;
ServerConfig* Config;
bool done;
public:
std::string TheUserUID;
- ConfigReaderThread(InspIRCd* Instance, const std::string &useruid)
- : Thread(), ServerInstance(Instance), done(false), TheUserUID(useruid)
+ ConfigReaderThread(const std::string &useruid)
+ : Thread(), done(false), TheUserUID(useruid)
{
}
/**** Functors ****/
- ProcessUserHandler HandleProcessUser;
IsNickHandler HandleIsNick;
IsIdentHandler HandleIsIdent;
FloodQuitUserHandler HandleFloodQuitUser;
IsSIDHandler HandleIsSID;
RehashHandler HandleRehash;
- /** BufferedSocket classes pending deletion after being closed.
- * We don't delete these immediately as this may cause a segmentation fault.
- */
- 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:
* kludge alert!
/** Config file pathname specified on the commandline or via ./configure
*/
- char ConfigFileName[MAXBUF];
+ std::string ConfigFileName;
/** Mode handler, handles mode setting and removal
*/
*/
time_t Time();
- /** Process a user whos socket has been flagged as active
- * @param cu The user to process
- * @return There is no actual return value, however upon exit, the user 'cu' may have been
- * marked for deletion in the global CullList.
- */
- caller1<void, User*> ProcessUser;
-
/** Bind all ports specified in the configuration file.
* @return The number of ports bound without error
*/
*/
void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
+ /** Handle /STATS
+ */
+ void DoStats(char statschar, User* user, string_list &results);
+
+ /** Handle /WHOIS
+ */
+ void DoWhois(User* user, User* dest,unsigned long signon, unsigned long idle, const char* nick);
+
/** Quit a user for excess flood, and if they are not
* fully registered yet, temporarily zline their IP.
* @param current user to quit
*/
int Run();
- /** Force all BufferedSockets to be removed which are due to
- * be culled.
- */
- void BufferedSocketCull();
-
/** Adds an extban char to the 005 token.
*/
void AddExtBanChar(char c);
ENTRYPOINT;
+template<class Cmd>
+class CommandModule : public Module
+{
+ Cmd cmd;
+ public:
+ CommandModule() : cmd(this)
+ {
+ ServerInstance->AddCommand(&cmd);
+ }
+
+ Version GetVersion()
+ {
+ return Version(cmd.command, VF_VENDOR);
+ }
+};
+
#endif