Dont think its the source, i took m_dummy.c and added my 3 lines.
No compile errors, but when i try to start unreal, i get this:
Code: Select all
* Loading IRCd configuration ..
* /home/irc/v3/testserver/unrealircd.conf:44: loadmodule src/modules/m_nounreg.so: failed to load: tmp/9DBC590A.m_nounreg.so: cannot open shared object file: No such file or directory
Any idea?
Oh btw, here's the module if you're interested. Maybe i did something wrong?
Code: Select all
/*
* Author: Stefan 'Fussi' Thomanek
* Version: 1.0.0.0
* Description: Only let IRCOps join all channels.
* Non-Opers only may join registered (+r) channels
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
#define MyMod Modnounreg->handle
DLLFUNC int m_nounreg(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
//#define MSG_DUMMY "nounreg" /* dummy */
//#define TOK_DUMMY "DU" /* 127 4ever !;) */
static ModuleInfo *Modnounreg;
static Hook *HookPreJoin;
static int cb_prejoin(aClient *sptr, aChannel *chptr, char *parv[]);
ModuleHeader MOD_HEADER(m_nounreg)
= {
"nounreg", /* Name of module */
"$Id: m_nounreg.c,v 1.0.0.0 2006/03/25 21:03:17 Fussi Exp $", /* Version */
"Reject the userjoin of nonregistered Channel", /* Short description of module */
"3.2-b8-1",
NULL
};
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_nounreg)(ModuleInfo *modinfo)
{
Modnounreg = modinfo;
return MOD_SUCCESS;
}
DLLFUNC int MOD_TEST(m_nounreg)(ModuleInfo *modinfo)
{
Modnounreg = modinfo;
return MOD_SUCCESS;
}
/* Is first run when server is 100% ready */
DLLFUNC int MOD_LOAD(m_nounreg)(int module_load)
{
HookAddEx(MyMod, HOOKTYPE_PRE_LOCAL_JOIN, cb_prejoin);
return MOD_SUCCESS;
}
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_nounreg)(int module_unload)
{
DelHook(HookPreJoin);
return MOD_SUCCESS;
}
static int cb_prejoin(aClient *sptr, aChannel *chptr, char *parv[])
{
if ((chptr->mode.mode & MODE_RGSTR) || IsAnOper(sptr) || IsSkoAdmin(sptr) || IsCoAdmin(sptr) || IsNetAdmin(sptr) || IsSAdmin(sptr))
{
return 1;
}
return 0;
}