Manual:DIL Manual/reboot

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:16, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

reboot

Procedure. Shuts the game server down.

reboot(code : integer)

The server stops after the current pass of its game loop: the players who are connected are saved and their connections closed, and vme exits with code as its exit status. Whether the game comes back depends on what started vme: a script or service manager that starts it again turns this into a reboot.

Only a program started in a zone with access level 0 (the fourth column of vme/etc/zonelist) can use it. What counts is the zone of the program's first template, the one that was dilcopy'd or run as a command. Elsewhere the zone log gets "attempt to violate system access security (reboot)" and the program stops.

Parameters

Name Type Meaning
code integer vme's exit status. 0 means all is well; the DIL integration tests (test.zon) exit with the number of a failed test, so the test script sees the failure.

Notes

  • The argument is required: reboot; is a syntax error.
  • The program goes on after reboot() until it waits or quits, and the rest of the current game loop pass runs too. End with quit.
  • It warns nobody. The reboot command (cmd_reboot and rebooting in commands.zon) counts down and tells the players first.

Example

dilbegin failsafe();
code
{
   heartbeat := PULSE_SEC * 60 * 5;
   wait(SFB_TICK, TRUE);
   log("Fail safe triggered");
   reboot(99);
   quit;
}
dilend

Stops the server with exit status 99 after five minutes, as the integration tests in test.zon do when a test hangs.

See also