Added verification of broadcast response message size Added clearer handling of message types I'm sure there's a better way to do debug logging, but I don't really feel like adding a dependency on another module just for that.
26 lines
461 B
JavaScript
Executable File
26 lines
461 B
JavaScript
Executable File
const SLMessage = require('./SLMessage.js').SLMessage;
|
|
|
|
const MSG_ID = 8120;
|
|
|
|
exports.SLVersionMessage = class SLVersionMessage extends SLMessage {
|
|
constructor(buf) {
|
|
super(0, MSG_ID);
|
|
if (buf) {
|
|
this._wroteSize = true;
|
|
this.writeBuffer(buf, 0);
|
|
|
|
this.decode();
|
|
}
|
|
}
|
|
|
|
decode() {
|
|
super.decode();
|
|
|
|
this.version = this.readSLString();
|
|
}
|
|
|
|
static getResponseId() {
|
|
return MSG_ID + 1;
|
|
}
|
|
}
|