同步dev 增加英雄的共鸣附加属性
This commit is contained in:
parent
45bb5eadfc
commit
de510f42ac
@ -76,7 +76,7 @@ func BenchmarkRedis(b *testing.B) {
|
||||
keys, _ := cache.Redis().HGetAllToMapString(key)
|
||||
// fmt.Println(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()
|
||||
_, err := pipe.Exec(ctx)
|
||||
// fmt.Println(v)
|
||||
|
@ -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 {
|
||||
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 {
|
||||
err = errors.New("log is nil")
|
||||
}
|
||||
}
|
||||
|
||||
return options, nil
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ func (this *arrayEncoder) EncodeToSliceJson(ptr unsafe.Pointer, w codecore.IWrit
|
||||
err = w.Error()
|
||||
return
|
||||
}
|
||||
ret[i] = BytesToString(w.Buffer())
|
||||
ret[i] = string(w.Buffer())
|
||||
w.Reset()
|
||||
}
|
||||
return
|
||||
|
@ -76,7 +76,7 @@ func (this *sliceEncoder) EncodeToSliceJson(ptr unsafe.Pointer, w codecore.IWrit
|
||||
err = w.Error()
|
||||
return
|
||||
}
|
||||
ret[i] = BytesToString(w.Buffer())
|
||||
ret[i] = string(w.Buffer())
|
||||
w.Reset()
|
||||
}
|
||||
return
|
||||
|
@ -282,7 +282,7 @@ func (this *structEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.IWrite
|
||||
err = w.Error()
|
||||
return
|
||||
}
|
||||
ret[field.toName] = BytesToString(w.Buffer())
|
||||
ret[field.toName] = string(w.Buffer())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -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) {
|
||||
//hero.EnergyProperty = data
|
||||
hero.EnergyProperty = data
|
||||
|
||||
if err := this.ChangeList(uid, hero.Id, map[string]interface{}{
|
||||
"enegryProperty": data,
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 记录一些扩展数据 图鉴 改名次数等
|
||||
@ -42,5 +43,6 @@ func (this *ModelRecord) ChangeUserRecord(uid string, value map[string]interface
|
||||
if len(value) == 0 {
|
||||
return nil
|
||||
}
|
||||
value["mtime"] = time.Now().Unix() //修改时间
|
||||
return this.Change(uid, value)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user