同步dev 增加英雄的共鸣附加属性

This commit is contained in:
meixiongfeng 2022-08-09 11:29:05 +08:00
parent 45bb5eadfc
commit de510f42ac
7 changed files with 11 additions and 9 deletions

View File

@ -76,7 +76,7 @@ func BenchmarkRedis(b *testing.B) {
keys, _ := cache.Redis().HGetAllToMapString(key) keys, _ := cache.Redis().HGetAllToMapString(key)
// fmt.Println(keys) // fmt.Println(keys)
for _, v := range keys { for _, v := range keys {
cache.Redis().Pipeline(ctx, func(pipe redis.Pipeliner) error { cache.Redis().Pipelined(ctx, func(pipe redis.Pipeliner) error {
pipe.HGetAll(ctx, v).Result() pipe.HGetAll(ctx, v).Result()
_, err := pipe.Exec(ctx) _, err := pipe.Exec(ctx)
// fmt.Println(v) // fmt.Println(v)

View File

@ -99,11 +99,11 @@ func newOptions(config map[string]interface{}, opts ...Option) (options *Options
if len(options.ServiceTag) == 0 || len(options.ServiceType) == 0 || len(options.ServiceId) == 0 || len(options.ConsulServers) == 0 { if len(options.ServiceTag) == 0 || len(options.ServiceType) == 0 || len(options.ServiceId) == 0 || len(options.ConsulServers) == 0 {
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常") return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
} }
if options.Debug && options.Log == nil {
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil { if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil {
err = errors.New("log is nil") err = errors.New("log is nil")
}
} }
return options, nil return options, nil
} }

View File

@ -65,7 +65,7 @@ func (this *arrayEncoder) EncodeToSliceJson(ptr unsafe.Pointer, w codecore.IWrit
err = w.Error() err = w.Error()
return return
} }
ret[i] = BytesToString(w.Buffer()) ret[i] = string(w.Buffer())
w.Reset() w.Reset()
} }
return return

View File

@ -76,7 +76,7 @@ func (this *sliceEncoder) EncodeToSliceJson(ptr unsafe.Pointer, w codecore.IWrit
err = w.Error() err = w.Error()
return return
} }
ret[i] = BytesToString(w.Buffer()) ret[i] = string(w.Buffer())
w.Reset() w.Reset()
} }
return return

View File

@ -282,7 +282,7 @@ func (this *structEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.IWrite
err = w.Error() err = w.Error()
return return
} }
ret[field.toName] = BytesToString(w.Buffer()) ret[field.toName] = string(w.Buffer())
} }
return return
} }

View File

@ -375,7 +375,7 @@ func (this *ModelHero) mergeAddProperty(uid string, hero *pb.DBHero, data map[st
// 合并附加能量属性 // 合并附加能量属性
func (this *ModelHero) mergeEnegryProperty(uid string, hero *pb.DBHero, data map[string]int32) { func (this *ModelHero) mergeEnegryProperty(uid string, hero *pb.DBHero, data map[string]int32) {
//hero.EnergyProperty = data hero.EnergyProperty = data
if err := this.ChangeList(uid, hero.Id, map[string]interface{}{ if err := this.ChangeList(uid, hero.Id, map[string]interface{}{
"enegryProperty": data, "enegryProperty": data,

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"time"
) )
// 记录一些扩展数据 图鉴 改名次数等 // 记录一些扩展数据 图鉴 改名次数等
@ -42,5 +43,6 @@ func (this *ModelRecord) ChangeUserRecord(uid string, value map[string]interface
if len(value) == 0 { if len(value) == 0 {
return nil return nil
} }
value["mtime"] = time.Now().Unix() //修改时间
return this.Change(uid, value) return this.Change(uid, value)
} }