Add onExit to instance template

This commit is contained in:
Cooldude2606 committed 2025-08-08 21:41:49 +01:00
1 parent 174d9d5b07
commit 7ceb786143
2 files changed
+15

No files matched your search

@@ -24,13 +24,21 @@ class InstancePlugin extends BaseInstancePlugin {
} }
async onStart() { async onStart() {
// Called once rcon becomes available
this.logger.info("instance::onStart"); this.logger.info("instance::onStart");
} }
async onStop() { async onStop() {
// Called during normal exits before rcon becomes unavailable
this.logger.info("instance::onStop"); this.logger.info("instance::onStop");
} }
onExit() {
// Called during all exits, including crashes and init failures, rcon is not available
this.logger.info("instance::onExit");
}
async onPlayerEvent(event) { async onPlayerEvent(event) {
this.logger.info(`onPlayerEvent::onPlayerEvent ${JSON.stringify(event)}`); this.logger.info(`onPlayerEvent::onPlayerEvent ${JSON.stringify(event)}`);
//%if module //%if module
@@ -31,13 +31,20 @@ export class InstancePlugin extends BaseInstancePlugin {
} }
async onStart() { async onStart() {
// Called once rcon becomes available
this.logger.info("instance::onStart"); this.logger.info("instance::onStart");
} }
async onStop() { async onStop() {
// Called during normal exits before rcon becomes unavailable
this.logger.info("instance::onStop"); this.logger.info("instance::onStop");
} }
onExit() {
// Called during all exits, including crashes and init failures, rcon is not available
this.logger.info("instance::onExit");
}
async onPlayerEvent(event: lib.PlayerEvent) { async onPlayerEvent(event: lib.PlayerEvent) {
this.logger.info(`onPlayerEvent::onPlayerEvent ${JSON.stringify(event)}`); this.logger.info(`onPlayerEvent::onPlayerEvent ${JSON.stringify(event)}`);
//%if module //%if module