diff --git a/server/imserver/app.go b/server/imserver/app.go index 03b6a3bc..c62cb996 100644 --- a/server/imserver/app.go +++ b/server/imserver/app.go @@ -26,9 +26,10 @@ func (this *App_) Init() { this.App_.Init(this.Update) this.msgList.Init(nil) this.workList.Init(nil) + f5.LoadMetaTable(mt.Table) HandlerMgr.Init() WSPListener.Init() - go this.goReportServerState(); + go this.goReportServerState() } func (this *App_) UnInit() { @@ -86,10 +87,7 @@ func (this *App_) addNetMsg(hdr *f5.MsgHdr) { this.msgList.AddTail(&hdr.Entry); } { - v := mt.ServerIdTable{} - v.Traverse(func (*mt.Server) { - - }) + mt.Table.Server.GetById(0) } this.NotifyLoopCond() } diff --git a/server/imserver/mt/go.mod b/server/imserver/mt/go.mod index e677407c..c3abaebd 100644 --- a/server/imserver/mt/go.mod +++ b/server/imserver/mt/go.mod @@ -2,5 +2,9 @@ module mt go 1.20 +require mtb v1.0.0 + require ( ) + +replace mtb => ../mtb \ No newline at end of file diff --git a/server/imserver/mtb/mtb.auto_gen.go b/server/imserver/mtb/mtb.auto_gen.go index 5e79047e..782b3264 100644 --- a/server/imserver/mtb/mtb.auto_gen.go +++ b/server/imserver/mtb/mtb.auto_gen.go @@ -1,6 +1,5 @@ package mtb - type Server struct { listen_port int32 } @@ -8,3 +7,4 @@ type Server struct { func (this *Server) GetListenPort() int32 { return this.listen_port } + diff --git a/third_party/f5 b/third_party/f5 index 0cea5671..22825917 160000 --- a/third_party/f5 +++ b/third_party/f5 @@ -1 +1 @@ -Subproject commit 0cea5671752bc0753d61aae993b8aa2b0df0ae18 +Subproject commit 2282591789752dfad7522c2c5068ff9d8d7cc9df diff --git a/third_party/q5 b/third_party/q5 index 6a998e6e..490774a7 160000 --- a/third_party/q5 +++ b/third_party/q5 @@ -1 +1 @@ -Subproject commit 6a998e6eea5c11ebc57df5b35d1d5a6fc122d0f8 +Subproject commit 490774a7a352b1209d40346bb254556ea194814e diff --git a/tools/pbtools/app.js b/tools/pbtools/app.js index f36b8b42..8790345b 100644 --- a/tools/pbtools/app.js +++ b/tools/pbtools/app.js @@ -175,7 +175,9 @@ func init() { async genMtbAutoGen() { let data = `package mtb - +import ( + "f5" +) `; this.mtPb.nested.mt.nestedArray.forEach( (item) => { @@ -183,7 +185,7 @@ func init() { item.fieldsArray.forEach ( (item2, index) => { - + data += ` f5.BaseMetaTableElement\n`; data += ` ${item2.name} ` + this.dumpClassField(item, item2, index) + `\n`; } ); @@ -196,7 +198,7 @@ func init() { item.fieldsArray.forEach ( (item2, index) => { - const newName = this.converCaseName(item2.name); + const newName = this.converUpperCamelCaseName(item2.name); data += `func (this *${item.name}) Get${newName}() ` + this.dumpClassField(item, item2, index) + ` {\n`; data += ` return this.${item2.name}\n`; @@ -233,7 +235,12 @@ func init() { ); this.mtPb.nested.mt.nestedArray.forEach( (item) => { - data += `func (this *${item.name}RawTable) Traverse(cb func (*${item.name})) {\n`; + data += `func (this *${item.name}RawTable) Traverse(cb func (*${item.name}) bool) {\n`; + data += ` for _, val := range this.rawList {\n`; + data += ` if !cb(val) {\n`; + data += ` break\n`; + data += ` }\n`; + data += ` }\n`; data += '}\n\n'; data += `func (this *${item.name}IdTable) GetById(id int64) *${item.name} {\n`; data += ` if v, ok := this.idHash[id]; ok {\n`; @@ -297,7 +304,7 @@ func init() { } } - converCaseName(name) { + converUpperCamelCaseName(name) { let newName = ''; let preIs_ = false; for (let i = 0; i < name.length; ++i) {