summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-02 12:38:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-02 12:38:41 +0000
commita753fb1bc711e10794e939e424f3cdd703116d82 (patch)
treebf17b41965232848b840c4340f74bec3741afae2 /src/modules.cpp
parent0ae832406f989194761528a1b8d49aa115c7fb3b (diff)
Added support for modules to create commands - this needs a proof-of-concept module yet, do not use unless you like to live dangerously.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@351 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 389fb60e3..820488c99 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -9,6 +9,7 @@
#include <iostream>
#include "globals.h"
#include "modules.h"
+#include "ctables.h"
#include "inspircd_io.h"
// class type for holding an extended mode character - internal to core
@@ -43,7 +44,7 @@ bool ModeDefined(char modechar, int type)
}
// returns number of parameters for a custom mode when it is switched on
-int ModeDefinedOn(char modechar, int type)
+bool ModeDefinedOn(char modechar, int type)
{
for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
{
@@ -56,7 +57,7 @@ int ModeDefinedOn(char modechar, int type)
}
// returns number of parameters for a custom mode when it is switched on
-int ModeDefinedOff(char modechar, int type)
+bool ModeDefinedOff(char modechar, int type)
{
for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
{
@@ -84,11 +85,6 @@ Version::Version(int major, int minor, int revision, int build) : Major(major),
Admin::Admin(std::string name, std::string email, std::string nick) : Name(name), Email(email), Nick(nick) { };
-//
-// Announce to the world that the Module base
-// class has been created or destroyed
-//
-
Module::Module() { }
Module::~Module() { }
void Module::OnUserConnect(userrec* user) { }
@@ -124,6 +120,12 @@ void Server::Log(int level, std::string s)
log(level,"%s",s.c_str());
}
+void Server::AddCommand(char* cmd, handlerfunc f, char flags, int minparams)
+{
+ createcommand(cmd,f,flags,minparams);
+}
+
+
void Server::Send(int Socket, std::string s)
{
Write(Socket,"%s",s.c_str());