mc-beta-server/server/packets/DisconnectKick.ts
2023-04-08 20:52:47 +01:00

20 lines
No EOL
511 B
TypeScript

import { Reader, Writer } from "../../bufferStuff";
import { Packets } from "../enums/Packets";
import { IPacket } from "./IPacket";
export class PacketDisconnectKick implements IPacket {
public packetId = Packets.DisconnectKick;
public reason:string;
public constructor(reason:string) {
this.reason = reason;
}
public readData(reader:Reader) {
return this;
}
public writeData() {
return new Writer(3 + this.reason.length * 2).writeUByte(this.packetId).writeString(this.reason).toBuffer();
}
}