These are old archives. They are kept for historic purposes only.
MajorGorth
Posts: 3 Joined: Sun Feb 15, 2009 2:56 pm
Post
by MajorGorth » Sat Feb 21, 2009 12:15 pm
Hey.
After adding a line for loading a self-programmed module which adds a Umode +c in unrealircd.conf I get following error when trying to start UnrealIRCd:
* Loading IRCd configuration ..
../../Unreal3.2.7/unreal: line 134: 25756 Speicherzugriffsfehler (core dumped) /home/irc/Unreal3.2.7/src/ircd
Possible error encountered (IRCd seemingly not started)
When removing that line, everything works fine.
Using it at Debian Etch 64 Bit.
Casper
Posts: 338 Joined: Sun Jul 08, 2007 7:44 am
Location: The Netherlands
Post
by Casper » Sat Feb 21, 2009 1:01 pm
It would be best to post your module around here so a coder can take a look at it.
Ex Network-Administrator
MajorGorth
Posts: 3 Joined: Sun Feb 15, 2009 2:56 pm
Post
by MajorGorth » Sun Feb 22, 2009 8:13 pm
Well then...
The module has no function yet but should be able to run and add the umode +c.
Code: Select all
/*
* ===================================================
* Filename: m_callop.c
* Description: Adds Usermode +c for callop receivers
* Author: MajorGorth
* History:
* - 1.0 (20090215) Initial release
* ===================================================
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "macros.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
extern void sendto_one(aClient* to, char *pattern, ...);
ModuleHeader MOD_HEADER(callop) = {"m_callop","$Id: m_adult.c,v 1.0 2009/02/15","Usermode +c for Anope plugin \"m_callop\"","3.2-beta8-1",NULL};
int allowedSet(aClient *sptr, int what);
#define UFLAG_CALLOP 'c'
#define DelUMode(x) if(x) UmodeDel(x); x = NULL
DLLFUNC int MOD_UNLOAD(callop)(int module_unload);
DLLFUNC int MOD_TEST(callop)(ModuleInfo *module);
DLLFUNC int MOD_INIT(callop)(ModuleInfo *module);
static Umode *CallopUMode;
static ModuleInfo *thisModInfo;
DLLFUNC int MOD_TEST(callop)(ModuleInfo *module)
{
CallopUMode = UmodeAdd(module->handle, UFLAG_CALLOP, UMODE_GLOBAL, allowedSet, 0);
if(!CallopUMode)
return MOD_FAILED;
else
return MOD_SUCCESS;
}
DLLFUNC int MOD_INIT(callop)(ModuleInfo *module)
{
thisModInfo = module;
#ifdef STATIC_LINKING
ModuleSetOptions(module->handle,MOD_OPT_PERM);
#endif
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(callop)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(callop)(int module_unload)
{
UmodeDel(CallopUMode);
return MOD_SUCCESS;
}
int allowedSet(aClient *sptr, int what)
{
if(IsServices(sptr) || IsNetAdmin(sptr))
return 1;
else
return 0;
}
Casper
Posts: 338 Joined: Sun Jul 08, 2007 7:44 am
Location: The Netherlands
Post
by Casper » Sun Feb 22, 2009 8:21 pm
As I'm not a coder, I can't help you further, but I'm sure someone pops up and tell you what you can do!
Ex Network-Administrator
MajorGorth
Posts: 3 Joined: Sun Feb 15, 2009 2:56 pm
Post
by MajorGorth » Fri Feb 27, 2009 12:28 pm
Casper wrote: As I'm not a coder, I can't help you further, but I'm sure someone pops up and tell you what you can do!
Thank you though...