上传重置埋点接口
This commit is contained in:
parent
cc6feb9dda
commit
79245aacef
@ -148,3 +148,20 @@ func (this *configureComp) getCondiDatas(tt int32) (result []*cfg.GameBuriedCond
|
|||||||
this.lock.RUnlock()
|
this.lock.RUnlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 读取埋点条件配置
|
||||||
|
func (this *configureComp) getCondiData(id int32) (result *cfg.GameBuriedCondiData, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_buriedcondi); err != nil {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
if result, ok = v.(*cfg.GameBuriedCondi).GetDataMap()[id]; !ok {
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_buriedcondi, id)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -155,7 +155,7 @@ func (this *Buried) ResetBuriedByType(uid string, types ...comm.TaskType) (err e
|
|||||||
if model, err = this.modelBuried.getburiedModel(uid); err != nil {
|
if model, err = this.modelBuried.getburiedModel(uid); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.Debug("激活埋点类型!", log.Field{Key: "types", Value: types})
|
this.Debug("重置埋点!", log.Field{Key: "types", Value: types})
|
||||||
lock, _ := this.modelBuried.userlock(uid)
|
lock, _ := this.modelBuried.userlock(uid)
|
||||||
err = lock.Lock()
|
err = lock.Lock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -169,11 +169,13 @@ func (this *Buried) ResetBuriedByType(uid string, types ...comm.TaskType) (err e
|
|||||||
for _, v := range types {
|
for _, v := range types {
|
||||||
if bdata, ok = bdatas.Items[int32(v)]; ok {
|
if bdata, ok = bdatas.Items[int32(v)]; ok {
|
||||||
for _, v1 := range bdata.Condi {
|
for _, v1 := range bdata.Condi {
|
||||||
v1.Value = 0
|
if v1.Value != 0 && v1.Finish != pb.BuriedItemFinishState_buried_finish {
|
||||||
v1.Statistics = make([]string, 0)
|
v1.Value = 0
|
||||||
v1.Timestamp = time.Now().Unix()
|
v1.Statistics = make([]string, 0)
|
||||||
v1.State = pb.BuriedItemState_Activated
|
v1.Timestamp = time.Now().Unix()
|
||||||
chanage = true
|
v1.State = pb.BuriedItemState_Activated
|
||||||
|
chanage = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user