diff --git a/Changes b/Changes index 52ffc01b8..cb6b33066 100644 --- a/Changes +++ b/Changes @@ -1823,3 +1823,4 @@ MOTDs the user sent along in "sentcmd". - Fixed typo in new module build switch - Added a Config -advanced prompt for --with-moduleswhich= +- Small fix in s_conf.c and Velcro diff --git a/src/s_conf.c b/src/s_conf.c index 8421d77a8..fe2406988 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -5948,7 +5948,7 @@ int _test_link(ConfigFile *conf, ConfigEntry *ce) errors++; } #endif - if (strchr(cep->ce_vardata, '*') != NULL || strchr(cep->ce_vardata, '?')) + if (strchr(cep->ce_vardata, '*') != NULL || strchr(cep->ce_vardata, '?') != NULL) { has_hostname_wildcards = 1; } diff --git a/u4modules/Clients.module b/u4modules/Clients.module new file mode 100644 index 000000000..85104a838 --- /dev/null +++ b/u4modules/Clients.module @@ -0,0 +1,97 @@ + +@version $Id$ +@copyright (C) 2007 Carsten Valdemar Munk + +class ILocalClient; +class IServer; + +class IClient +{ + public: + virtual char *getName() = 0; + virtual void *getInternal() = 0; + virtual IServer& getIServer() = 0; + virtual ILocalClient *getILocalClient() = 0; + virtual ~IClient() {} +}; + +class ILocalClient : public IClient +{ + public: + virtual ILocalClient *getILocalClient(); + virtual ~ILocalClient() {} +}; + + + +implementation: + +// Glue for Unreal3 +extern "C" +{ +#include "config.h" +#include "struct.h" +#include "common.h" +#include "sys.h" +#include "numeric.h" +#include "msg.h" +#include "proto.h" +#include "channel.h" +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#endif +#include +#include "h.h" +#ifdef STRIPBADWORDS +#include "badwords.h" +#endif +#ifdef _WIN32 +#include "version.h" +#endif +} + +class U3Client : public ILocalClient +{ + public: + U3Client(aClient *instance) + { + acptr = instance; + } + + virtual void *getInternal() + { + return (void *) acptr; + } + + virtual char *getName() + { + return acptr->name; + } + + virtual ILocalClient *getILocalClient() + { + if (acptr->from == &me) + return this; + else return NULL; + } + + virtual IServer *getServer() + { + return NULL; + } + + private: + aClient *acptr; +}; + + +ILocalClient* ILocalClient::getILocalClient() +{ + return this; +} + diff --git a/u4modules/Velcro.module b/u4modules/Velcro.module index 56b55e7d4..59e87d53a 100644 --- a/u4modules/Velcro.module +++ b/u4modules/Velcro.module @@ -210,55 +210,28 @@ bool Velcro::dependsOnModule(const char *who, const char *module) } modulesLoading.push_back(ms); config_status("Loading module %s as a dependancy of %s", module, who); - snprintf(buf, 1024, "u4modules/%s.so", module); - void *dl = dlopen(buf, RTLD_LAZY|RTLD_LOCAL); - if (dl == NULL) + snprintf(buf, 1024, "u4modules/%s.depends", module); + void *dl; + FILE *f = fopen(buf, "r"); + if (f == NULL) { - config_status("Velcro: Error loading dependancy %s for %s: %s, possible error/RTLD_LAZY broken, trying old fashioned dependancy loading and trying again afterwards", - module, who, dlerror()); - snprintf(buf, 1024, "u4modules/%s.depends", module); - FILE *f = fopen(buf, "r"); - if (f == NULL) - { - config_error("Velcro: Error opening depends file for %s: %s", - module, strerror(errno)); - return false; - } - char *ss; - while ((ss = fgets(buf, 1023, f)) != NULL) - { - char *p = strchr(ss, '\r'); - if (p != NULL) - *p = 0; - p = strchr(ss, '\n'); - if (p != NULL) - *p = 0; - if (*ss == 0) - continue; - if (!dependsOnModule(module, ss)) - return false; - } + config_error("Velcro: Error opening depends file for %s: %s", + module, strerror(errno)); + return false; } - else + char *ss; + while ((ss = fgets(buf, 1023, f)) != NULL) { - snprintf(buf, 1024, "%s_checkDepends", module); - - VoidIntPointerParaFunctionPointer *depend = (VoidIntPointerParaFunctionPointer *) dlsym(dl, buf); - if (depend == NULL) - { - config_error("Velcro: Error loading dependancy %s for %s: Unable to find %s_checkDepends", - module, who, module); + char *p = strchr(ss, '\r'); + if (p != NULL) + *p = 0; + p = strchr(ss, '\n'); + if (p != NULL) + *p = 0; + if (*ss == 0) + continue; + if (!dependsOnModule(module, ss)) return false; - } - // kludge.. no idea why it doesn't work with int * - int ret = 0; - (*depend)(&ret); - if (ret == -1) - { - dlclose(dl); - return false; - } - dlclose(dl); } /* now done loading dependancies, reopen with RTLD_GLOBAL|RTLD_NOW .. */ snprintf(buf, 1024, "u4modules/%s.so", module); diff --git a/velcro/build b/velcro/build index 17fadd289..c22bc4b4f 100755 --- a/velcro/build +++ b/velcro/build @@ -4,5 +4,5 @@ echo --- Preprocessing $1 .. echo --- Building dependancies for $1 cat $1.depends | ../velcro/epl ../velcro/build echo --- Building $1 -g++ -Wall -DDYNAMIC_LINKING -fPIC -DPIC -shared -export-dynamic -I../extras/regexp/include -I../include -o $1.so $1.cc +g++ -g -Wall -DDYNAMIC_LINKING -fPIC -DPIC -shared -export-dynamic -I../extras/regexp/include -I../include -o $1.so $1.cc echo --- Done building $1