1
This commit is contained in:
parent
28662526ee
commit
0a8cad1af4
@ -2,11 +2,18 @@ package mtb
|
|||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
listen_port int32
|
listen_port int32
|
||||||
|
|
||||||
|
_flags1_ uint64
|
||||||
|
_flags2_ uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Server) GetListenPort() int32 {
|
func (this *Server) GetListenPort() int32 {
|
||||||
return this.listen_port
|
return this.listen_port
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Server) LoadFromKv(kv map[string]interface{}) {
|
func (this *Server) HasListenPort() bool {
|
||||||
|
return (this._flags2_ & (uint64(1) << (64 - 64))) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Server) LoadFromKv(map[string]interface{}) {
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ option go_package = ".;mt";
|
|||||||
|
|
||||||
message Server
|
message Server
|
||||||
{
|
{
|
||||||
optional int32 listen_port = 1;
|
optional int32 listen_port = 64;
|
||||||
}
|
}
|
||||||
|
2
third_party/f5
vendored
2
third_party/f5
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 07ab6ec2aaeff9115cb3ccdca7a2bc04225dea0f
|
Subproject commit 8263b4ded97fe73bd62d01a44b2cfd2d58824755
|
@ -1,6 +1,7 @@
|
|||||||
const protobuf = require('protobufjs');
|
const protobuf = require('protobufjs');
|
||||||
const parseArgs = require('minimist');
|
const parseArgs = require('minimist');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const assert = require('assert');
|
||||||
|
|
||||||
class PBTools {
|
class PBTools {
|
||||||
|
|
||||||
@ -181,11 +182,15 @@ func init() {
|
|||||||
data += `type ${item.name} struct {\n`;
|
data += `type ${item.name} struct {\n`;
|
||||||
item.fieldsArray.forEach
|
item.fieldsArray.forEach
|
||||||
(
|
(
|
||||||
(item2, index) => {
|
(item2, index) => {
|
||||||
|
assert(item2.id <= 127);
|
||||||
data += ` ${item2.name} ` + this.dumpClassField(item, item2, index) + `\n`;
|
data += ` ${item2.name} ` + this.dumpClassField(item, item2, index) + `\n`;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
data += '}';
|
data += `
|
||||||
|
_flags1_ uint64
|
||||||
|
_flags2_ uint64
|
||||||
|
}`;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
data += '\n\n';
|
data += '\n\n';
|
||||||
@ -198,6 +203,13 @@ func init() {
|
|||||||
data += `func (this *${item.name}) Get${newName}() ` +
|
data += `func (this *${item.name}) Get${newName}() ` +
|
||||||
this.dumpClassField(item, item2, index) + ` {\n`;
|
this.dumpClassField(item, item2, index) + ` {\n`;
|
||||||
data += ` return this.${item2.name}\n`;
|
data += ` return this.${item2.name}\n`;
|
||||||
|
data += `}\n\n`;
|
||||||
|
data += `func (this *${item.name}) Has${newName}() bool {\n`;
|
||||||
|
if (item2.id < 64) {
|
||||||
|
data += ` return (this._flags1_ & (uint64(1) << ${item2.id})) > 0\n`;
|
||||||
|
} else {
|
||||||
|
data += ` return (this._flags2_ & (uint64(1) << (${item2.id} - 64))) > 0\n`;
|
||||||
|
}
|
||||||
data += `}\n`;
|
data += `}\n`;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user