Initial progress

This commit is contained in:
Jack Hadrill
2022-02-01 02:12:49 +00:00
parent 0f2f619e96
commit a93bfc182f
10 changed files with 209 additions and 15 deletions

16
src/structures/server.ts Normal file
View File

@@ -0,0 +1,16 @@
import { BufferReader } from '../buffer-reader'
export class IncomingPacket extends BufferReader {
messageType: number
senderId: number
length: number
data: Buffer
constructor (data: Buffer) {
super()
this.messageType = this.readUInt16()
this.senderId = this.readUInt32()
this.length = this.readUInt16()
this.data = this.readBuffer(this.length)
}
}