This commit is contained in:
rosetta
2026-01-30 05:01:05 +02:00
commit 83f38dc63f
327 changed files with 18725 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import Stream from "./stream";
/**
* Packet abstract class
*/
export default abstract class Packet {
/**
* Get the packet ID
* @returns packet ID
*/
public abstract getPacketId(): number;
/**
* Use the stream to read the packet and fill structure
* @param stream stream
*/
public abstract _receive(stream: Stream): void;
/**
* Use the stream to write the packet and return the stream
* @returns stream
*/
public abstract _send(): Promise<Stream> | Stream;
public clone(): Packet {
return new (this as any).constructor();
}
}