* ---------------------------------------------------
*/
+using namespace std;
+
#include "users.h"
#include "channels.h"
#include "modules.h"
Server *Srv;
public:
- ModuleFoobar()
+ ModuleFoobar(Server* Me)
+ : Module::Module(Me)
{
- // The constructor just creates an instance of the server class
+ // The constructor just makes a copy of the server class
- Srv = new Server;
+ Srv = Me;
}
virtual ~ModuleFoobar()
{
- // destructor deletes the instance of the server class
-
- delete Srv;
}
virtual Version GetVersion()
// this method instantiates a class of type Version, and returns
// the modules version information using it.
- return Version(1,0,0,0,0);
+ return Version(1,0,0,1,VF_VENDOR);
}
virtual void OnUserConnect(userrec* user)
Srv->Log(DEBUG,"Foobar: User connecting: " + b);
}
- virtual void OnUserQuit(userrec* user)
+ virtual void OnUserQuit(userrec* user, std::string reason)
{
// method called when a user disconnects
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleFoobar;
+ return new ModuleFoobar(Me);
}
};