strlcpy(this->host, dbhost.c_str(), MAXBUF);
strlcpy(this->IP, dbhost.c_str(), MAXBUF);
this->port = dbport;
- idle = TIME;
+ idle = this->Instance->Time();
this->ClosePending = false;
/* We just read stuff from the server, that counts as it being alive
* so update the idle-since time :p
*/
- idle = TIME;
+ idle = this->Instance->Time();
if(PQisBusy(sql))
{
// OR
// The number of target channels is equal to the number of channels the sender is on..a little suspicious.
// Check it's more than 1 too, or else users on one channel would have fun.
- if((m && (m->message == parameters[1]) && (m->target != parameters[0]) && (ForgetDelay != -1) && (m->sent >= TIME-ForgetDelay)) || ((targets > 1) && (targets == userchans)))
+ if((m && (m->message == parameters[1]) && (m->target != parameters[0]) && (ForgetDelay != -1) && (m->sent >= ServerInstance->Time()-ForgetDelay)) || ((targets > 1) && (targets == userchans)))
{
// Block it...
if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS)
// If there's already a BlockedMessage allocated, use it.
m->message = parameters[1];
m->target = parameters[0];
- m->sent = TIME;
+ m->sent = ServerInstance->Time();
}
else
{
- m = new BlockedMessage(parameters[1], parameters[0], TIME);
+ m = new BlockedMessage(parameters[1], parameters[0], ServerInstance->Time());
user->Extend("amsgblock", (char*)m);
}
}
/* seconds to wait when the server just booted */
boot_wait = conf->ReadInteger("connflood", "bootwait", 0, true);
- first = TIME;
+ first = ServerInstance->Time();
}
virtual void OnUserRegister(userrec* user)
{
- time_t next = TIME;
+ time_t next = ServerInstance->Time();
if (!first)
first = next - boot_wait;
void SendHeaders(unsigned long size, int response, const std::string &extraheaders)
{
- struct tm *timeinfo = localtime(&TIME);
+ time_t local = this->Instance->Time();
+ struct tm *timeinfo = localtime(&local);
this->Write("HTTP/1.1 "+ConvToStr(response)+" "+Response(response)+"\r\nDate: ");
this->Write(asctime(timeinfo));
if (extraheaders.empty())
public:
- ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,TIME), ServerInstance(Instance)
+ ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,Instance->Time()), ServerInstance(Instance)
{
}
user->GetExt("safelist_last", last_list_time);
if (last_list_time)
{
- if (TIME < (*last_list_time)+60)
+ if (ServerInstance->Time() < (*last_list_time)+60)
{
user->WriteServ("NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick);
return 1;
/*
* start at channel 0! ;)
*/
- ld = new ListData(0,TIME);
+ ld = new ListData(0,ServerInstance->Time());
user->Extend("safelist_cache", ld);
listusers.push_back(user);
time_t* llt = new time_t;
- *llt = TIME;
+ *llt = ServerInstance->Time();
user->Extend("safelist_last", llt);
return 1;
if (!validated)
return 0;
- if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
+ if ((command == "LIST") && (ServerInstance->Time() < (user->signon+60)) && (!*user->oper))
{
user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
/* Some crap clients (read: mIRC, various java chat applets) muck up if they don't