Manual:DIL Manual/resettime
Jump to navigation
Jump to search
Contents
resettime
Field (integer, read-only; on a zoneptr).
z.resettime : integer
The minutes between two resets of the zone: the lifespan in the zone file's %zone header (60 when the header has none). The server adds up to three random minutes to each wait, so that zones don't all reset at the same moment. Whether the zone resets at all is in resetmode.
Notes
- A zone with lifespan 0 isn't reset, not even at boot.
- It can't be assigned (vmc: "Illegal lvalue").
- On a null zoneptr it fails.
Example
dilbegin door_ticker();
var
zon : zoneptr;
code
{
zon := findzone(self.zoneidx);
if (zon == null)
quit;
heartbeat := zon.resettime * 60 * PULSE_SEC;
:start:
wait(SFB_TICK, TRUE);
log(self.nameidx + "@" + self.zoneidx + ": the zone's reset time has passed.");
goto start;
}
dilend
Ticks once per reset period of the zone a unit comes from, as the secret doors in basemove.zon do.