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

42 lines
1.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const UUID_1 = require("../UUID");
const MessageFlags_1 = require("../../enums/MessageFlags");
class RpcChannelReplyPacket {
constructor() {
this.name = 'RpcChannelReply';
this.flags = MessageFlags_1.MessageFlags.Trusted | MessageFlags_1.MessageFlags.FrequencyLow;
this.id = 4294902174;
}
getSize() {
return 48;
}
writeToBuffer(buf, pos) {
const startPos = pos;
this.DataBlock['TaskID'].writeToBuffer(buf, pos);
pos += 16;
this.DataBlock['ItemID'].writeToBuffer(buf, pos);
pos += 16;
this.DataBlock['ChannelID'].writeToBuffer(buf, pos);
pos += 16;
return pos - startPos;
}
readFromBuffer(buf, pos) {
const startPos = pos;
const newObjDataBlock = {
TaskID: UUID_1.UUID.zero(),
ItemID: UUID_1.UUID.zero(),
ChannelID: UUID_1.UUID.zero()
};
newObjDataBlock['TaskID'] = new UUID_1.UUID(buf, pos);
pos += 16;
newObjDataBlock['ItemID'] = new UUID_1.UUID(buf, pos);
pos += 16;
newObjDataBlock['ChannelID'] = new UUID_1.UUID(buf, pos);
pos += 16;
this.DataBlock = newObjDataBlock;
return pos - startPos;
}
}
exports.RpcChannelReplyPacket = RpcChannelReplyPacket;
//# sourceMappingURL=RpcChannelReply.js.map