Initial progress
This commit is contained in:
16
src/structures/server.ts
Normal file
16
src/structures/server.ts
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user