diff --git a/server/hallserver/app/app.go b/server/hallserver/app/app.go index 9ee7b3df..98df0c4f 100644 --- a/server/hallserver/app/app.go +++ b/server/hallserver/app/app.go @@ -81,20 +81,4 @@ func (this *app) AddNetMsg(hdr *f5.MsgHdr) { } func (this *app) registerDataSources() { - f5.GetJsStyleDb().RegisterDataSource( - constant.GAME_DB, - mt.Table.GameDb.GetById(0).GetHost(), - mt.Table.GameDb.GetById(0).GetPort(), - mt.Table.GameDb.GetById(0).GetUser(), - mt.Table.GameDb.GetById(0).GetPasswd(), - mt.Table.GameDb.GetById(0).GetDatabase(), - 30) - f5.GetJsStyleDb().RegisterDataSource( - constant.FRIEND_DB, - mt.Table.FriendDb.GetById(0).GetHost(), - mt.Table.FriendDb.GetById(0).GetPort(), - mt.Table.FriendDb.GetById(0).GetUser(), - mt.Table.FriendDb.GetById(0).GetPasswd(), - mt.Table.FriendDb.GetById(0).GetDatabase(), - 30) } diff --git a/server/hallserver/mt/FriendDb.go b/server/hallserver/mt/FriendDb.go deleted file mode 100644 index ad5f270c..00000000 --- a/server/hallserver/mt/FriendDb.go +++ /dev/null @@ -1,15 +0,0 @@ -package mt - -import ( - "f5" - "mtb" -) - -type FriendDb struct { - mtb.FriendDb -} - -type FriendDbTable struct { - f5.IdMetaTable[FriendDb] - selfConf *FriendDb -} diff --git a/server/hallserver/mt/GameDb.go b/server/hallserver/mt/GameDb.go deleted file mode 100644 index ff9aa3f4..00000000 --- a/server/hallserver/mt/GameDb.go +++ /dev/null @@ -1,17 +0,0 @@ -package mt - -import ( - "f5" - "mtb" -) - -type GameDb struct { - mtb.GameDb -} - -type GameDbTable struct { - f5.IdMetaTable[GameDb] -} - -func (this *GameDb) Init1() { -} diff --git a/server/hallserver/mt/export.go b/server/hallserver/mt/export.go index 3e24fc52..a44a0574 100644 --- a/server/hallserver/mt/export.go +++ b/server/hallserver/mt/export.go @@ -7,8 +7,6 @@ import ( type table struct { HallCluster *HallClusterTable MasterCluster *MasterClusterTable - GameDb *GameDbTable - FriendDb *FriendDbTable Config *ConfigTable } @@ -23,16 +21,6 @@ var Table = f5.New(func (this* table) { this.PrimKey = "instance_id" }); - this.GameDb = f5.New(func (this *GameDbTable) { - this.FileName = "../config/gamedb.mysql.json" - this.PrimKey = "" - }); - - this.FriendDb = f5.New(func (this *FriendDbTable) { - this.FileName = "../config/frienddb.mysql.json" - this.PrimKey = "" - }); - this.Config = f5.New(func (this *ConfigTable) { this.FileName = "../config/config.json" this.PrimKey = "" diff --git a/server/hallserver/mtb/mtb.auto_gen.go b/server/hallserver/mtb/mtb.auto_gen.go index ff88c3a5..a765dbdb 100644 --- a/server/hallserver/mtb/mtb.auto_gen.go +++ b/server/hallserver/mtb/mtb.auto_gen.go @@ -22,28 +22,6 @@ type MasterCluster struct { _flags2_ uint64 } -type GameDb struct { - host string - port int32 - user string - passwd string - database string - - _flags1_ uint64 - _flags2_ uint64 -} - -type FriendDb struct { - host string - port int32 - user string - passwd string - database string - - _flags1_ uint64 - _flags2_ uint64 -} - type Config struct { gameapi_url string auto_start_time int32 @@ -102,86 +80,6 @@ func (this *MasterCluster) HasListenPort() bool { return (this._flags1_ & (uint64(1) << 3)) > 0 } -func (this *GameDb) GetHost() string { - return this.host -} - -func (this *GameDb) HasHost() bool { - return (this._flags1_ & (uint64(1) << 1)) > 0 -} - -func (this *GameDb) GetPort() int32 { - return this.port -} - -func (this *GameDb) HasPort() bool { - return (this._flags1_ & (uint64(1) << 2)) > 0 -} - -func (this *GameDb) GetUser() string { - return this.user -} - -func (this *GameDb) HasUser() bool { - return (this._flags1_ & (uint64(1) << 3)) > 0 -} - -func (this *GameDb) GetPasswd() string { - return this.passwd -} - -func (this *GameDb) HasPasswd() bool { - return (this._flags1_ & (uint64(1) << 4)) > 0 -} - -func (this *GameDb) GetDatabase() string { - return this.database -} - -func (this *GameDb) HasDatabase() bool { - return (this._flags1_ & (uint64(1) << 5)) > 0 -} - -func (this *FriendDb) GetHost() string { - return this.host -} - -func (this *FriendDb) HasHost() bool { - return (this._flags1_ & (uint64(1) << 1)) > 0 -} - -func (this *FriendDb) GetPort() int32 { - return this.port -} - -func (this *FriendDb) HasPort() bool { - return (this._flags1_ & (uint64(1) << 2)) > 0 -} - -func (this *FriendDb) GetUser() string { - return this.user -} - -func (this *FriendDb) HasUser() bool { - return (this._flags1_ & (uint64(1) << 3)) > 0 -} - -func (this *FriendDb) GetPasswd() string { - return this.passwd -} - -func (this *FriendDb) HasPasswd() bool { - return (this._flags1_ & (uint64(1) << 4)) > 0 -} - -func (this *FriendDb) GetDatabase() string { - return this.database -} - -func (this *FriendDb) HasDatabase() bool { - return (this._flags1_ & (uint64(1) << 5)) > 0 -} - func (this *Config) GetGameapiUrl() string { return this.gameapi_url } @@ -227,22 +125,6 @@ func (this *MasterCluster) LoadFromKv(kv map[string]interface{}) { f5.ReadMetaTableField(&this.listen_port, "listen_port", &this._flags1_, 3, kv) } -func (this *GameDb) LoadFromKv(kv map[string]interface{}) { - f5.ReadMetaTableField(&this.host, "host", &this._flags1_, 1, kv) - f5.ReadMetaTableField(&this.port, "port", &this._flags1_, 2, kv) - f5.ReadMetaTableField(&this.user, "user", &this._flags1_, 3, kv) - f5.ReadMetaTableField(&this.passwd, "passwd", &this._flags1_, 4, kv) - f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv) -} - -func (this *FriendDb) LoadFromKv(kv map[string]interface{}) { - f5.ReadMetaTableField(&this.host, "host", &this._flags1_, 1, kv) - f5.ReadMetaTableField(&this.port, "port", &this._flags1_, 2, kv) - f5.ReadMetaTableField(&this.user, "user", &this._flags1_, 3, kv) - f5.ReadMetaTableField(&this.passwd, "passwd", &this._flags1_, 4, kv) - f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv) -} - func (this *Config) LoadFromKv(kv map[string]interface{}) { f5.ReadMetaTableField(&this.gameapi_url, "gameapi_url", &this._flags1_, 1, kv) f5.ReadMetaTableField(&this.auto_start_time, "auto_start_time", &this._flags1_, 2, kv) diff --git a/server/hallserver/proto/mt.proto b/server/hallserver/proto/mt.proto index 38cc5abf..f13a33f2 100644 --- a/server/hallserver/proto/mt.proto +++ b/server/hallserver/proto/mt.proto @@ -16,24 +16,6 @@ message MasterCluster optional int32 listen_port = 3; } -message GameDb -{ - optional string host = 1; - optional int32 port = 2; - optional string user = 3; - optional string passwd = 4; - optional string database = 5; -} - -message FriendDb -{ - optional string host = 1; - optional int32 port = 2; - optional string user = 3; - optional string passwd = 4; - optional string database = 5; -} - message Config { optional string gameapi_url = 1;