Error message handler
This commit is contained in:
parent
9680949503
commit
2463cc3dbc
|
@ -92,6 +92,18 @@ class FLYSocket {
|
|||
// s: DataStream
|
||||
}
|
||||
|
||||
handle_packet255(data) {
|
||||
// Hxs
|
||||
// H: Length
|
||||
// s: ErrorMessage
|
||||
let ret = "";
|
||||
let length = data.getUint16(this.pointer); this.pointer += 2;
|
||||
for (let i = 0; i < length; i++) {
|
||||
ret += String.fromCharCode( data.getUint8(this.pointer++) );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
handle_packetInvalid(data) {
|
||||
throw TypeError(`Invalid DATA: ${Array.from( this.buffer2HexArray(data, --this.pointer) ).join(" ")}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user