Files
node-metaverse/dist/classes/messages/NearestLandingRegionRequest.js
2017-12-13 15:23:50 +00:00

36 lines
1.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Long = require("long");
const MessageFlags_1 = require("../../enums/MessageFlags");
const Message_1 = require("../../enums/Message");
class NearestLandingRegionRequestMessage {
constructor() {
this.name = 'NearestLandingRegionRequest';
this.messageFlags = MessageFlags_1.MessageFlags.Trusted | MessageFlags_1.MessageFlags.FrequencyLow;
this.id = Message_1.Message.NearestLandingRegionRequest;
}
getSize() {
return 8;
}
writeToBuffer(buf, pos) {
const startPos = pos;
buf.writeInt32LE(this.RequestingRegionData['RegionHandle'].low, pos);
pos += 4;
buf.writeInt32LE(this.RequestingRegionData['RegionHandle'].high, pos);
pos += 4;
return pos - startPos;
}
readFromBuffer(buf, pos) {
const startPos = pos;
let varLength = 0;
const newObjRequestingRegionData = {
RegionHandle: Long.ZERO
};
newObjRequestingRegionData['RegionHandle'] = new Long(buf.readInt32LE(pos), buf.readInt32LE(pos + 4));
pos += 8;
this.RequestingRegionData = newObjRequestingRegionData;
return pos - startPos;
}
}
exports.NearestLandingRegionRequestMessage = NearestLandingRegionRequestMessage;
//# sourceMappingURL=NearestLandingRegionRequest.js.map