Новая сериализация, оптимизации приема и парсинга пакетов
This commit is contained in:
@@ -18,14 +18,14 @@ export class PacketSync extends Packet {
|
||||
|
||||
public _receive(stream: Stream): void {
|
||||
this.status = stream.readInt8() as SyncStatus;
|
||||
this.timestamp = stream.readInt64();
|
||||
this.timestamp = Number(stream.readInt64());
|
||||
}
|
||||
|
||||
public _send(): Promise<Stream> | Stream {
|
||||
let stream = new Stream();
|
||||
stream.writeInt16(this.getPacketId());
|
||||
stream.writeInt8(this.status);
|
||||
stream.writeInt64(this.timestamp);
|
||||
stream.writeInt64(BigInt(this.timestamp));
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user