aozhiwei 89cb16593d 1
2023-08-11 14:02:40 +08:00

43 lines
861 B
JavaScript

const protobuf = require('protobufjs');
const parseArgs = require('minimist');
function prettyJsonEncode(obj) {
return JSON.stringify(obj, "", " ");
}
class PBTools {
constructor() {
this.csMsgIdPb = null;
this.csProtoPb = null;
this.ssMsgIdPb = null;
this.ssProtoPb = null;
this.mtPb = null;
this.protoDir = './proto/';
}
async init() {
{
this.csProtoPb = await (new protobuf.Root()).load(
this.protoDir + 'cs_proto.proto',
{
'keepCase': true
}
);
}
{
this.csMsgIdPb = await (new protobuf.Root()).load(
this.protoDir + 'cs_msgid.proto',
{
'keepCase': true
}
);
//this.cmMsgId = this.msgIdPb.lookup('CMMessageId_e');
//this.smMsgId = this.msgIdPb.lookup('SMMessageId_e');
}
}
}
(new PBTools).init();