timedShutdown

  • builtin
  • by Takaro
  • Takaro >=0.0.1
  • all
Version

Built-in modules ship with Takaro — no import needed.

View export JSON

Automatically shut down the server at a specific time.

Configuration 1

Settings you fill in when installing the module on a server.

SettingTypeDefaultDescription
warningMessage required Warning message string "Server is shutting down in 5 minutes!" Message to send to players before the server shuts down.
Raw config schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "warningMessage": {
      "type": "string",
      "title": "Warning message",
      "description": "Message to send to players before the server shuts down.",
      "default": "Server is shutting down in 5 minutes!",
      "minLength": 1,
      "maxLength": 1024
    }
  },
  "required": [
    "warningMessage"
  ]
}
Raw UI schema
{}

Cron jobs 2

Work the module runs on a schedule.

  • Shutdown

    Cron job source
    import { data, takaro } from '@takaro/helpers';
    async function main() {
        const { gameServerId } = data;
        await takaro.gameserver.gameServerControllerShutdown(gameServerId);
    }
    await main();
    //# sourceMappingURL=Shutdown.js.map
  • warning

    Cron job source
    import { data, takaro } from '@takaro/helpers';
    async function main() {
        const { gameServerId } = data;
        const msg = data.module.userConfig.warningMessage;
        await takaro.gameserver.gameServerControllerSendMessage(gameServerId, {
            message: msg,
        });
    }
    await main();
    //# sourceMappingURL=warning.js.map