From 3de0068376cf0b168261a5ed6ba7857c84fb5e08 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 4 Sep 2023 18:37:59 +0800 Subject: [PATCH] 1 --- server/adminserver/app.go | 3 --- server/adminserver/mt/AdminCluster.go | 18 +++++++++--------- server/adminserver/mt/export.go | 2 +- server/adminserver/mtb/mtb.auto_gen.go | 16 ++++++++-------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/server/adminserver/app.go b/server/adminserver/app.go index 3b31e00f..fb3baa66 100644 --- a/server/adminserver/app.go +++ b/server/adminserver/app.go @@ -1,11 +1,8 @@ package main import ( - "cs" "f5" "mt" - "q5" - "ss" ) type App struct { diff --git a/server/adminserver/mt/AdminCluster.go b/server/adminserver/mt/AdminCluster.go index 9873bb82..a33ed038 100644 --- a/server/adminserver/mt/AdminCluster.go +++ b/server/adminserver/mt/AdminCluster.go @@ -5,28 +5,28 @@ import ( "mtb" ) -type IMCluster struct { - mtb.IMCluster +type AdminCluster struct { + mtb.AdminCluster } -type IMClusterTable struct { - f5.IdMetaTable[IMCluster] - selfConf *IMCluster +type AdminClusterTable struct { + f5.IdMetaTable[AdminCluster] + selfConf *AdminCluster } -func (this *IMCluster) Init1() { +func (this *AdminCluster) Init1() { } -func (this *IMClusterTable) GetListenPort() int32 { +func (this *AdminClusterTable) GetListenPort() int32 { return this.selfConf.GetListenPort() } -func (this *IMClusterTable) GetHttpListenPort() int32 { +func (this *AdminClusterTable) GetHttpListenPort() int32 { return this.selfConf.GetHttpListenPort() } -func (this *IMClusterTable) PostInit1() { +func (this *AdminClusterTable) PostInit1() { this.selfConf = this.GetById(int64(f5.GetApp().GetInstanceId())) if this.selfConf == nil { panic("imserver集群无法读取本服配置") diff --git a/server/adminserver/mt/export.go b/server/adminserver/mt/export.go index 5d8fc1f2..99a1c4ee 100644 --- a/server/adminserver/mt/export.go +++ b/server/adminserver/mt/export.go @@ -12,7 +12,7 @@ type table struct { } var Table = f5.New(func (this* table) { - this.IMCluster = f5.New(func (this *IMClusterTable) { + this.AdminCluster = f5.New(func (this *AdminClusterTable) { this.FileName = "../config/imserver.cluster.json" this.PrimKey = "instance_id" }); diff --git a/server/adminserver/mtb/mtb.auto_gen.go b/server/adminserver/mtb/mtb.auto_gen.go index 99dcae10..7b90731c 100644 --- a/server/adminserver/mtb/mtb.auto_gen.go +++ b/server/adminserver/mtb/mtb.auto_gen.go @@ -4,7 +4,7 @@ import ( "f5" ) -type IMCluster struct { +type AdminCluster struct { instance_id int32 listen_port int32 http_listen_port int32 @@ -51,27 +51,27 @@ type Config struct { _flags2_ uint64 } -func (this *IMCluster) GetInstanceId() int32 { +func (this *AdminCluster) GetInstanceId() int32 { return this.instance_id } -func (this *IMCluster) HasInstanceId() bool { +func (this *AdminCluster) HasInstanceId() bool { return (this._flags1_ & (uint64(1) << 1)) > 0 } -func (this *IMCluster) GetListenPort() int32 { +func (this *AdminCluster) GetListenPort() int32 { return this.listen_port } -func (this *IMCluster) HasListenPort() bool { +func (this *AdminCluster) HasListenPort() bool { return (this._flags1_ & (uint64(1) << 2)) > 0 } -func (this *IMCluster) GetHttpListenPort() int32 { +func (this *AdminCluster) GetHttpListenPort() int32 { return this.http_listen_port } -func (this *IMCluster) HasHttpListenPort() bool { +func (this *AdminCluster) HasHttpListenPort() bool { return (this._flags1_ & (uint64(1) << 3)) > 0 } @@ -188,7 +188,7 @@ func (this *Config) HasGameapiUrl() bool { } -func (this *IMCluster) LoadFromKv(kv map[string]interface{}) { +func (this *AdminCluster) LoadFromKv(kv map[string]interface{}) { f5.ReadMetaTableField(&this.instance_id, "instance_id", &this._flags1_, 1, kv) f5.ReadMetaTableField(&this.listen_port, "listen_port", &this._flags1_, 2, kv) f5.ReadMetaTableField(&this.http_listen_port, "http_listen_port", &this._flags1_, 3, kv)