#include "socket.h"
#include "typedefs.h"
#include "command_parse.h"
+#include <dlfcn.h>
using irc::sockets::NonBlocking;
using irc::sockets::Blocking;
{
printf("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
printf("(C) ChatSpike Development team.\033[0m\n\n");
- printf("Developers:\t\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special\033[0m\n");
+ printf("Developers:\t\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special, pippijn, jamie\033[0m\n");
printf("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
printf("Name concept:\t\t\033[1;32mLord_Zathras\033[0m\n\n");
}
FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
}
-void InspIRCd::SetSignals(bool SEGVHandler)
+void InspIRCd::SetSignals()
{
signal(SIGALRM, SIG_IGN);
signal(SIGHUP, InspIRCd::Rehash);
InspIRCd::InspIRCd(int argc, char** argv)
: ModCount(-1), duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365)
{
- bool SEGVHandler = false;
-
modules.resize(255);
factory.resize(255);
{
sleep(6);
}
- else if (!strcmp(argv[i],"-nolimit"))
- {
- printf("WARNING: The `-nolimit' option is deprecated, and now on by default. This behaviour may change in the future.\n");
- }
- else if (!strcmp(argv[i],"-notraceback"))
- {
- SEGVHandler = false;
- }
else if (!strcmp(argv[i],"-logfile"))
{
if (argc > i+1)
}
else
{
- printf("Usage: %s [-nofork] [-nolog] [-debug] [-wait] [-nolimit] [-notraceback] [-logfile <filename>]\n",argv[0]);
+ printf("Usage: %s [-nofork] [-nolog] [-debug] [-wait] [-logfile <filename>]\n",argv[0]);
Exit(ERROR);
}
}
memset(&Config->implement_lists,0,sizeof(Config->implement_lists));
printf("\n");
- this->SetSignals(SEGVHandler);
+ this->SetSignals();
if (!Config->nofork)
{
if (!this->DaemonSeed())
{
if (v == j)
{
+ delete *t;
factory.erase(t);
factory.push_back(NULL);
return;
if ((long)factory[this->ModCount+1]->factory != -1)
{
Module* m = factory[this->ModCount+1]->factory->CreateModule(this);
+
+ Version v = m->GetVersion();
+
+ if (v.API != API_VERSION)
+ {
+ delete m;
+ delete a;
+ this->Log(DEFAULT,"Unable to load %s: Incorrect module API version: %d (our version: %d)",modfile,v.API,API_VERSION);
+ snprintf(MODERR,MAXBUF,"Loader/Linker error: Incorrect module API version: %d (our version: %d)",v.API,API_VERSION);
+ return false;
+ }
+ else
+ {
+ this->Log(DEFAULT,"New module introduced: %s (API version %d, Module version %d.%d.%d.%d)%s", filename, v.API, v.Major, v.Minor, v.Revision, v.Build, (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
+ }
+
modules[this->ModCount+1] = m;
/* save the module and the module's classfactory, if
* this isnt done, random crashes can occur :/ */
WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME));
if ((TIME % 3600) == 0)
{
- irc::whowas::MaintainWhoWas(TIME);
+ irc::whowas::MaintainWhoWas(this, TIME);
}
Timers->TickTimers(TIME);
this->DoBackgroundUserStuff(TIME);
}
-bool InspIRCd::IsNick(const char* n)
-{
- if (!n || !*n)
- return false;
-
- int p = 0;
- for (char* i = (char*)n; *i; i++, p++)
- {
- /* "A"-"}" can occur anywhere in a nickname */
- if ((*i >= 'A') && (*i <= '}'))
- {
- continue;
- }
- /* "0"-"9", "-" can occur anywhere BUT the first char of a nickname */
- if ((((*i >= '0') && (*i <= '9')) || (*i == '-')) && (i > n))
- {
- continue;
- }
- /* invalid character! abort */
- return false;
- }
- return (p < NICKMAX - 1);
-}
-
int InspIRCd::Run()
{
while (true)