MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / PingMinecraftServerTask

Class PingMinecraftServerTask

daemon/src/entity/commands/task/mc_players.ts:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5// When the instance is running, continue to check the expiration time
6export default class PingMinecraftServerTask implements ILifeCycleTask {
7 public status: number = 0;
8 public name: string = "TimeCheck";
9
10 private task?: NodeJS.Timeout;
11
12 async start(instance: Instance) {
13 this.task = setInterval(() => {
14 instance.execPreset("refreshPlayers");
15 }, 1000 * 60);
16 }
17
18 async stop(instance: Instance) {
19 instance.resetPingInfo();
20 clearInterval(this.task);
21 this.task = undefined;
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected