moomooio-client
Version:
MooMooIO-Client is a client-side wrapper API designed for the game MooMoo.io. This package aims to provide a simple yet powerful API for creating clones, mods, or plugins for MooMoo.io.
22 lines (18 loc) • 799 B
text/typescript
import { z } from "zod";
const schema = z.tuple([z.number()]);
/**
* @packet-id "20"
* @description **ShutdownNotice** is a message for your player that tells you the server is going to shut down.
* @param `minutes` indicates the number of minutes left before the shutdown.
* @param `seconds` indicates the number of seconds left before the shutdown.
*/
export default class ShutdownNotice {
public static readonly PACKET_ID = "20";
public static readonly PACKET_NAME = "ShutdownNotice";
public readonly PACKET_NAME = "ShutdownNotice";
constructor(readonly minutes: number, readonly seconds: number) {}
static parse(data: unknown): ShutdownNotice {
const [time] = schema.parse(data);
return new ShutdownNotice(Math.floor(time / 60), time % 60);
}
}