补充跨服id 获取接口
This commit is contained in:
parent
a28f4a5396
commit
9431b19d2e
@ -104,6 +104,11 @@ func (this *ModuleBase) Start() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
//获取跨服标签
|
||||
func (this *ModuleBase) GetCrossTag() string {
|
||||
return db.CrossTag()
|
||||
}
|
||||
|
||||
func (this *ModuleBase) GetUserSession(uid string) (session comm.IUserSession, ok bool) {
|
||||
var udata *pb.CacheUser
|
||||
if udata = this.ModuleUser.GetUserSession(uid); udata == nil {
|
||||
|
@ -8,6 +8,8 @@ type (
|
||||
ISys interface {
|
||||
//本服数据连接
|
||||
Local() (conn *DBConn, err error)
|
||||
//跨服区服id
|
||||
CrossTag() string
|
||||
//本服数据连接
|
||||
Cross() (conn *DBConn, err error)
|
||||
//跨服列表数据层连接
|
||||
@ -51,6 +53,10 @@ func Local() (conn *DBConn, err error) {
|
||||
return defsys.Local()
|
||||
}
|
||||
|
||||
func CrossTag() string {
|
||||
return defsys.CrossTag()
|
||||
}
|
||||
|
||||
func Cross() (conn *DBConn, err error) {
|
||||
return defsys.Cross()
|
||||
}
|
||||
|
@ -107,6 +107,10 @@ func (this *DB) Local() (conn *DBConn, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *DB) CrossTag() string {
|
||||
return this.options.CrossTag
|
||||
}
|
||||
|
||||
func (this *DB) Cross() (conn *DBConn, err error) {
|
||||
conn = this.cross
|
||||
if conn == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user