2023-06-13 02:43:52 +02:00
|
|
|
export default abstract class OutputPacket {
|
2023-06-18 20:29:42 +02:00
|
|
|
send (ws: WebSocket): void {
|
2023-06-13 02:43:52 +02:00
|
|
|
ws.send(JSON.stringify({
|
2023-06-18 20:29:42 +02:00
|
|
|
command: this.command(),
|
|
|
|
data: this.data()
|
2023-06-13 02:43:52 +02:00
|
|
|
}))
|
|
|
|
}
|
2023-06-18 20:29:42 +02:00
|
|
|
abstract data (): any
|
|
|
|
abstract command (): string
|
2023-06-13 02:43:52 +02:00
|
|
|
}
|