Files
desktop/app/providers/ProtocolProvider/protocol/packets/packet.requestupdate.ts
rosetta 83f38dc63f 'init'
2026-01-30 05:01:05 +02:00

65 lines
1.5 KiB
TypeScript

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> | 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;
}
}