import Packet from "../packet"; import Stream from "../stream"; export class PacketRequestUpdate extends Packet { private kernelVersion: string = ""; private appVersion: string = ""; private arch: string = ""; private platform: string = ""; public getPacketId(): number { return 0xA; } public _receive(stream: Stream): void { this.kernelVersion = stream.readString(); this.appVersion = stream.readString(); this.arch = stream.readString(); this.platform = stream.readString(); } public _send(): Promise | Stream { let stream = new Stream(); stream.writeInt16(this.getPacketId()); stream.writeString(this.kernelVersion); stream.writeString(this.appVersion); stream.writeString(this.arch); stream.writeString(this.platform); return stream; } public setKernelVersion(version: string): void { this.kernelVersion = version; } public getKernelVersion(): string { return this.kernelVersion; } public setAppVersion(version: string): void { this.appVersion = version; } public getAppVersion(): string { return this.appVersion; } public setArch(arch: string): void { this.arch = arch; } public getArch(): string { return this.arch; } public setPlatform(platform: string): void { this.platform = platform; } public getPlatform(): string { return this.platform; } }