extern char LOG_FILE[MAXBUF];
int openSockfd[MAXSOCKS];
int yield_depth;
+int iterations = 0;
sockaddr_in client,server;
socklen_t length;
{
expire_run = false;
}
+
+ if (iterations++ == 15)
+ {
+ iterations = 0;
+ DoBackgroundUserStuff(TIME);
+ }
/* Once a second, do the background processing */
if (TIME != OLDTIME)
{
if (TIME < OLDTIME)
WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME));
- DoBackgroundUserStuff(TIME);
+ if ((TIME % 3600) == 0)
+ {
+ MaintainWhoWas(TIME);
+ }
}
/* Process timeouts on module sockets each time around
}
catch (ModuleException& modexcept)
{
- log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
+ log(DEBUG,"Module exception cought: %s",modexcept.GetReason());
}
}
stats->statsAccept++;
* what we would do, so for now, its going
* to safely do bugger all.
*/
+ SE->DelFd(activefds[activefd]);
break;
}
}
if (!Config->nofork)
{
- freopen("/dev/null","w",stdout);
- freopen("/dev/null","w",stderr);
+ fclose(stdout);
+ fclose(stderr);
+ fclose(stdin);
}
/* Add the listening sockets used for client inbound connections
/* main loop, this never returns */
expire_run = false;
yield_depth = 0;
+ iterations = 0;
while (true)
{