庆典活动
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 {
|
if activity.Itype == comm.HdCelebration {
|
||||||
// key := fmt.Sprintf("%s-%s", session.GetUserId(), id)
|
// 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 已经挑战的次数
|
// 注意 Gotarr:map[int32]int32 key value 已经挑战的次数
|
||||||
if !utils.IsToday(data.Lasttime) { // 不是今天重置
|
if !utils.IsToday(data.Lasttime) { // 不是今天重置
|
||||||
data.Lasttime = configure.Now().Unix()
|
data.Lasttime = configure.Now().Unix()
|
||||||
@ -67,6 +67,13 @@ func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdD
|
|||||||
update["val"] = data.Val
|
update["val"] = data.Val
|
||||||
update["gotarr"] = data.Gotarr
|
update["gotarr"] = data.Gotarr
|
||||||
this.module.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
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)
|
data = append(data, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ActivityGetListResp{
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ActivityGetListResp{
|
||||||
Data: data,
|
Data: data,
|
||||||
})
|
})
|
||||||
|
@ -227,35 +227,28 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
|
|||||||
update["gotarr"] = data.Gotarr
|
update["gotarr"] = data.Gotarr
|
||||||
bChange = true
|
bChange = true
|
||||||
}
|
}
|
||||||
var pos int32
|
|
||||||
|
|
||||||
for index, v := range this.configure.GetHDCelebrationData() {
|
if conf, err := this.configure.GetHDCelebration(data.Val); err != nil {
|
||||||
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.Systemtype == systemtype {
|
if conf.Systemtype == systemtype {
|
||||||
data.Gotarr[bosstype] += 1
|
data.Gotarr[bosstype] += 1
|
||||||
// 天数
|
// 天数
|
||||||
var idays int32
|
var idays int32
|
||||||
for i, v1 := range conf.Bosstype {
|
for i, v1 := range conf.Bosstype {
|
||||||
if v1 == systemtype || v1 == 0 { // bosstype 为0 表示所有的boss 类型都算
|
if v1 == systemtype || v1 == 0 { // bosstype 为0 表示所有的boss 类型都算
|
||||||
idays = conf.Num[i]
|
idays = conf.Num[i]
|
||||||
break
|
break
|
||||||
}
|
|
||||||
}
|
|
||||||
// 更新信息
|
|
||||||
update["gotarr"] = data.Gotarr
|
|
||||||
bChange = true
|
|
||||||
if data.Gotarr[bosstype] <= idays {
|
|
||||||
bDouble = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 更新信息
|
||||||
|
update["gotarr"] = data.Gotarr
|
||||||
|
bChange = true
|
||||||
|
if data.Gotarr[bosstype] <= idays {
|
||||||
|
bDouble = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if bChange {
|
if bChange {
|
||||||
this.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
this.modelhdData.ModifyActivityList(session.GetUserId(), data.Id, update)
|
||||||
// 推送活动数据进度变化
|
// 推送活动数据进度变化
|
||||||
|
Loading…
Reference in New Issue
Block a user