perf[protocol]: 使用模板生成协议

This commit is contained in:
jaysunxiao
2022-05-16 23:15:24 +08:00
parent 3a59f06043
commit 5eb2530eae
39 changed files with 40 additions and 40 deletions
@@ -0,0 +1,26 @@
{}
const {} = function({}) {
{}
};
{}.prototype.protocolId = function() {
return {};
};
{}.write = function(buffer, packet) {
if (buffer.writePacketFlag(packet)) {
return;
}
{}
};
{}.read = function(buffer) {
if (!buffer.readBoolean()) {
return null;
}
const packet = new {}();
{}
return packet;
};
export default {};