Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
@Packet name EquiptmentCapacitiesMaximum
|
||||
@Packet identifier 156
|
||||
@Description -
|
||||
@Data pId, cannonSlots, harpoonerSlots, sailSlots, pirateSlots
|
||||
@Structure -
|
||||
*/
|
||||
|
||||
module.exports = function (data) {
|
||||
const packetLength = data.length * 2 + 1 + 1;
|
||||
const buffer = new ArrayBuffer(packetLength);
|
||||
const view = new DataView(buffer);
|
||||
|
||||
view.setUint8(0, 156);
|
||||
view.setUint8(1, packetLength);
|
||||
|
||||
data.forEach((e, i) => {
|
||||
view.setUint16(2 + i * 2, e);
|
||||
});
|
||||
|
||||
return buffer;
|
||||
};
|
||||
Reference in New Issue
Block a user