Новая обработка обновлений в соответствии с новым протоколом предоставляемым SDU серверами
This commit is contained in:
@@ -2,64 +2,34 @@ 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 = "";
|
||||
private updateServer: 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();
|
||||
this.updateServer = 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);
|
||||
stream.writeString(this.updateServer);
|
||||
return stream;
|
||||
}
|
||||
|
||||
public setKernelVersion(version: string): void {
|
||||
this.kernelVersion = version;
|
||||
public setUpdateServer(updateServer: string) {
|
||||
this.updateServer = updateServer;
|
||||
}
|
||||
|
||||
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;
|
||||
public getUpdateServer(): string {
|
||||
return this.updateServer;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user