Новая сериализация, оптимизации приема и парсинга пакетов

This commit is contained in:
RoyceDa
2026-03-26 22:28:43 +02:00
parent bd3c0eec69
commit fd3fac54f6
3 changed files with 359 additions and 126 deletions

View File

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