庆典活动
This commit is contained in:
parent
eb835f6ae7
commit
ad79b477e6
@ -55,7 +55,7 @@ func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdD
|
||||
// 获取开服庆典活动
|
||||
if activity.Itype == comm.HdCelebration {
|
||||
// key := fmt.Sprintf("%s-%s", session.GetUserId(), id)
|
||||
if data, err := this.module.modelhdData.getHddataByOid(session.GetUserId(), id); err != nil {
|
||||
if data, err := this.module.modelhdData.getHddataByOid(session.GetUserId(), id); err == nil {
|
||||
// 注意 Gotarr:map[int32]int32 key value 已经挑战的次数
|
||||
if !utils.IsToday(data.Lasttime) { // 不是今天重置
|
||||
data.Lasttime = configure.Now().Unix()
|
||||
@ -67,6 +67,13 @@ func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdD
|
||||
update["val"] = data.Val
|
||||
update["gotarr"] = data.Gotarr
|
||||
this.module.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
||||
result = append(result, data)
|
||||
} else { // 第一次进入
|
||||
_sub := (configure.Now().Unix() - activity.Stime)
|
||||
data.Val = int32(_sub/(24*3600)) + 1
|
||||
update := make(map[string]interface{})
|
||||
update["val"] = data.Val
|
||||
this.module.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.ActivityGetListR
|
||||
data = append(data, v)
|
||||
}
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ActivityGetListResp{
|
||||
Data: data,
|
||||
})
|
||||
|
@ -227,13 +227,8 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
|
||||
update["gotarr"] = data.Gotarr
|
||||
bChange = true
|
||||
}
|
||||
var pos int32
|
||||
|
||||
for index, v := range this.configure.GetHDCelebrationData() {
|
||||
for i := 0; i < int(v); i++ {
|
||||
pos++
|
||||
if data.Val == pos {
|
||||
if conf, err := this.configure.GetHDCelebration(int32(index) + 1); err != nil {
|
||||
if conf, err := this.configure.GetHDCelebration(data.Val); err != nil {
|
||||
|
||||
if conf.Systemtype == systemtype {
|
||||
data.Gotarr[bosstype] += 1
|
||||
@ -253,9 +248,7 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if bChange {
|
||||
this.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
||||
// 推送活动数据进度变化
|
||||
|
Loading…
Reference in New Issue
Block a user