mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-20 03:26:57 +00:00
29 lines
566 B
JavaScript
29 lines
566 B
JavaScript
// @author jaysunxiao
|
|
// @version 3.0
|
|
const ObjectB = function(flag) {
|
|
this.flag = flag; // boolean
|
|
};
|
|
|
|
ObjectB.prototype.protocolId = function() {
|
|
return 103;
|
|
};
|
|
|
|
ObjectB.write = function(buffer, packet) {
|
|
if (buffer.writePacketFlag(packet)) {
|
|
return;
|
|
}
|
|
buffer.writeBoolean(packet.flag);
|
|
};
|
|
|
|
ObjectB.read = function(buffer) {
|
|
if (!buffer.readBoolean()) {
|
|
return null;
|
|
}
|
|
const packet = new ObjectB();
|
|
const result0 = buffer.readBoolean();
|
|
packet.flag = result0;
|
|
return packet;
|
|
};
|
|
|
|
export default ObjectB;
|