diff --git a/README.md b/README.md index 8c38db66..6a923208 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,5 @@ CREATE TABLE `t_xxx` ( 表字段没特别原因下,必须有默认值 表名称t_开始 + +node ../../tools/pbtools/app.js diff --git a/server/imserver/mt/Config.go b/server/imserver/mt/Config.go new file mode 100644 index 00000000..a7fdaed8 --- /dev/null +++ b/server/imserver/mt/Config.go @@ -0,0 +1,15 @@ +package mt + +import ( + "f5" + "mtb" +) + +type Config struct { + mtb.Config +} + +type ConfigTable struct { + f5.IdMetaTable[Config] + selfConf *Config +} diff --git a/server/imserver/mt/FriendDb.go b/server/imserver/mt/FriendDb.go new file mode 100644 index 00000000..ad5f270c --- /dev/null +++ b/server/imserver/mt/FriendDb.go @@ -0,0 +1,15 @@ +package mt + +import ( + "f5" + "mtb" +) + +type FriendDb struct { + mtb.FriendDb +} + +type FriendDbTable struct { + f5.IdMetaTable[FriendDb] + selfConf *FriendDb +} diff --git a/server/imserver/mt/export.go b/server/imserver/mt/export.go index 1dfa9f5a..5f5a43a3 100644 --- a/server/imserver/mt/export.go +++ b/server/imserver/mt/export.go @@ -8,6 +8,8 @@ type table struct { IMCluster *IMClusterTable MasterCluster *MasterClusterTable GameDb *GameDbTable + FriendDb *FriendDbTable + Config *ConfigTable } var Table = f5.New(func (this* table) { @@ -26,4 +28,13 @@ var Table = f5.New(func (this* table) { 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/imserver/mtb/mtb.auto_gen.go b/server/imserver/mtb/mtb.auto_gen.go index 2733ccf1..99dcae10 100644 --- a/server/imserver/mtb/mtb.auto_gen.go +++ b/server/imserver/mtb/mtb.auto_gen.go @@ -33,6 +33,24 @@ type GameDb struct { _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 + + _flags1_ uint64 + _flags2_ uint64 +} + func (this *IMCluster) GetInstanceId() int32 { return this.instance_id } @@ -121,6 +139,54 @@ 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 +} + +func (this *Config) HasGameapiUrl() bool { + return (this._flags1_ & (uint64(1) << 1)) > 0 +} + func (this *IMCluster) LoadFromKv(kv map[string]interface{}) { f5.ReadMetaTableField(&this.instance_id, "instance_id", &this._flags1_, 1, kv) @@ -141,3 +207,15 @@ func (this *GameDb) LoadFromKv(kv map[string]interface{}) { 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) +} diff --git a/server/imserver/proto/mt.proto b/server/imserver/proto/mt.proto index 3bc665d0..8249bb8e 100644 --- a/server/imserver/proto/mt.proto +++ b/server/imserver/proto/mt.proto @@ -24,3 +24,17 @@ message GameDb 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; +}