Skip to content
Snippets Groups Projects
Commit 475939a8 authored by rswindell's avatar rswindell
Browse files

Bugfix: when enforcing an external program's max time value, was comparing

timeleft (in seconds) with the configured max time (in minutes) and
setting the amount of time allowed in the door to max time, so a user
could easily get extra time in a door if the max time option was used.
Enforcing 15-bit time left (in seconds) cap for chain.txt (WWIV) doors, works
around doors that interpret this value as a signed 16-bit value.
parent bef580a8
No related branches found
No related tags found
No related merge requests found
......@@ -448,6 +448,9 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
return;
}
if(tleft>0x7fff) /* Reduce time-left for broken 16-bit doors */
tleft=0x7fff; /* That interpret this value as a signed short */
sprintf(str,"%u\n%s\n%s\n%s\n%u\n%c\n"
,useron.number /* User number */
,name /* User name */
......@@ -1646,7 +1649,7 @@ bool sbbs_t::exec_xtrn(uint xtrnnum)
gettimeleft();
tleft=timeleft+(cfg.xtrn[xtrnnum]->textra*60);
if(cfg.xtrn[xtrnnum]->maxtime && tleft>cfg.xtrn[xtrnnum]->maxtime)
if(cfg.xtrn[xtrnnum]->maxtime && tleft>(cfg.xtrn[xtrnnum]->maxtime*60))
tleft=(cfg.xtrn[xtrnnum]->maxtime*60);
xtrndat(name,dropdir,cfg.xtrn[xtrnnum]->type,tleft,cfg.xtrn[xtrnnum]->misc);
if(!online)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment