* ---------------------------------------------------
*/
-#include <stdlib.h>
-#include <string>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "inspircd.h"
/* $ModDesc: Forces connecting clients to send a PONG message back to the server before they can complete their connection */
class ModuleWaitPong : public Module
{
- InspIRCd* Instance;
bool sendsnotice;
bool killonbadreply;
const char* extenstr;
public:
ModuleWaitPong(InspIRCd* Me)
- : Module::Module(Me), Instance(Me), extenstr("waitpong_pingstr")
+ : Module(Me), extenstr("waitpong_pingstr")
{
OnRehash(NULL,"");
}
virtual void OnRehash(userrec* user, const std::string ¶m)
{
- ConfigReader Conf(Instance);
+ ConfigReader Conf(ServerInstance);
sendsnotice = Conf.ReadFlag("waitpong", "sendsnotice", 0);
if(pingrpl)
{
- ServerInstance->Log(DEBUG,"PONG command - has extend");
if(strcmp(pingrpl, parameters[0]) == 0)
{
DELETE(pingrpl);
};
-class ModuleWaitPongFactory : public ModuleFactory
-{
- public:
- ModuleWaitPongFactory()
- {
- }
-
- ~ModuleWaitPongFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleWaitPong(Me);
- }
-};
-
-
-extern "C" void * init_module( void )
-{
- return new ModuleWaitPongFactory;
-}
+MODULE_INIT(ModuleWaitPong)