* but you can't have everything in a macro ;)
*/
#define abs_expire(exp) \
- ((exp) >= CurrentTime - PASTWATCH ? (exp) : (exp) + CurrentTime)
+ ((exp) >= TStime() - PASTWATCH ? (exp) : (exp) + TStime())
/*
* ms_gline - server message handler
"target %s, mask %s, operforce %s, action %c, expire %Tu, "
"lastmod %Tu, reason: %s", target, mask,
flags & GLINE_OPERFORCE ? "YES" : "NO",
- action == GLINE_ACTIVATE ? '+' : '-', expire, CurrentTime,
+ action == GLINE_ACTIVATE ? '+' : '-', expire, TStime(),
reason));
sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s %Tu %Tu :%s",
acptr, flags & GLINE_OPERFORCE ? "!" : "",
action == GLINE_ACTIVATE ? '+' : '-', mask,
- expire - CurrentTime, CurrentTime, reason);
+ expire - TStime(), TStime(), reason);
return 0; /* all done */
}
if (!agline || /* gline creation, has to be the reason */
/* trial-convert as lifetime, and if it doesn't fully convert,
* it must be the reason */
- ((lifetime = strtoul(parv[5], &tmp, 10)) && !*tmp)) {
+ (!(lifetime = strtoul(parv[5], &tmp, 10)) && !*tmp)) {
lifetime = 0;
reason = parv[5];
return need_more_params(sptr, "GLINE");
target = parv[2]; /* get the target... */
- expire = strtol(parv[3], &end, 10) + CurrentTime; /* and the expiration */
+ expire = strtol(parv[3], &end, 10) + TStime(); /* and the expiration */
if (*end != '\0')
return send_reply(sptr, SND_EXPLICIT | ERR_BADEXPIRE, "%s :Bad expire time", parv[3]);
if (parc > 3) {
/* get expiration and target */
reason = parv[parc - 1];
- expire = strtol(parv[parc - 2], &end, 10) + CurrentTime;
+ expire = strtol(parv[parc - 2], &end, 10) + TStime();
if (*end != '\0')
return send_reply(sptr, SND_EXPLICIT | ERR_BADEXPIRE, "%s :Bad expire time", parv[parc - 2]);
sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s %Tu %Tu :%s",
acptr, flags & GLINE_OPERFORCE ? "!" : "",
action == GLINE_ACTIVATE ? '+' : '-', mask,
- expire - CurrentTime, CurrentTime, reason);
+ expire - TStime(), TStime(), reason);
return 0; /* all done */
}
if (agline) /* modifying an existing G-line */
return gline_modify(cptr, sptr, agline, action, reason, expire,
- CurrentTime, 0, flags);
+ TStime(), 0, flags);
assert(action != GLINE_LOCAL_ACTIVATE);
assert(action != GLINE_LOCAL_DEACTIVATE);
assert(action != GLINE_MODIFY);
/* create a new G-line */
- return gline_add(cptr, sptr, mask, reason, expire, CurrentTime, 0,
+ return gline_add(cptr, sptr, mask, reason, expire, TStime(), 0,
flags | ((action == GLINE_ACTIVATE) ? GLINE_ACTIVE : 0));
}