Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
64644e2b29
@ -720,7 +720,9 @@ const (
|
||||
Reddot24 ReddotType = 10024 //熊猫武馆----可升级红点
|
||||
Reddot25 ReddotType = 10025 //熊猫武馆----可领取奖励红点
|
||||
Reddot33 ReddotType = 10033 //附魔副本 有挑战次数
|
||||
|
||||
//武馆派遣
|
||||
Reddot18105 ReddotType = 18105 //熊猫武馆功夫派遣界面倒计时
|
||||
Reddot18112 ReddotType = 18112 //熊猫武馆功夫派遣界面进度奖励待领取
|
||||
// 羁绊
|
||||
Reddot19103 ReddotType = 19103 // 当好感度奖励可以领取时,出现好感度奖励领取红点
|
||||
Reddot19105 ReddotType = 19105 //当英雄等级解锁到一定程度,下方传记解锁新的传记的时候
|
||||
|
@ -13,33 +13,35 @@ func (a *apiComp) AutoreceiveCheck(session comm.IUserSession, req *pb.DispatchAu
|
||||
|
||||
func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
info *pb.DBDispatch
|
||||
res []*cfg.Gameatn
|
||||
rss []*pb.DispatchTaskRsp
|
||||
atno []*pb.UserAtno
|
||||
err error
|
||||
)
|
||||
rsp := &pb.DispatchAutoReceiveResp{}
|
||||
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if d == nil {
|
||||
if info, err = a.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// var flag bool
|
||||
for _, v := range d.Nb.Tasks {
|
||||
for _, v := range info.Nb.Tasks {
|
||||
if v.Status == 2 {
|
||||
// flag = true
|
||||
d.Nb.TaskCount++
|
||||
d.Nb.WeekCount++
|
||||
info.Nb.TaskCount++
|
||||
info.Nb.WeekCount++
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
tasks, oldTasks := a.module.modelDispatch.replaceFinishedTask(session.GetUserId(), d)
|
||||
tasks, oldTasks := a.module.modelDispatch.replaceFinishedTask(session.GetUserId(), info)
|
||||
|
||||
//更新公告任务
|
||||
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), d.Nb, tasks); err != nil {
|
||||
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), info.Nb, tasks); err != nil {
|
||||
a.module.Debug("更新公告失败", log.Field{Key: "uid", Value: session.GetUserId()})
|
||||
return
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ func (a *apiComp) DoCheck(session comm.IUserSession, req *pb.DispatchDoReq) (err
|
||||
func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
tasks []*pb.BuriedParam
|
||||
info *pb.DBDispatch
|
||||
err error
|
||||
)
|
||||
if errdata = this.DoCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -67,11 +69,10 @@ func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errda
|
||||
return
|
||||
}
|
||||
|
||||
d := this.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if d == nil && d.Nb == nil {
|
||||
if info, err = this.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -86,7 +87,7 @@ func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errda
|
||||
return
|
||||
}
|
||||
|
||||
if err := this.module.modelDispatch.dispatch(session.GetUserId(), req.TaskId, req.HeroIds, d); err != nil {
|
||||
if err := this.module.modelDispatch.dispatch(session, info, req.TaskId, req.HeroIds); err != nil {
|
||||
var errCustom = new(comm.CustomError)
|
||||
var code pb.ErrorCode
|
||||
if errors.As(err, &errCustom) {
|
||||
|
@ -15,19 +15,23 @@ func (a *apiComp) NoticeCheck(session comm.IUserSession, req *pb.DispatchNoticeR
|
||||
}
|
||||
|
||||
func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (errdata *pb.ErrorData) {
|
||||
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if d == nil {
|
||||
var (
|
||||
info *pb.DBDispatch
|
||||
err error
|
||||
)
|
||||
|
||||
if info, err = a.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
uid := session.GetUserId()
|
||||
rsp := &pb.DispatchNoticeResp{}
|
||||
|
||||
if len(d.Nb.Tasks) == 0 {
|
||||
tasks, err := a.module.modelDispatch.taskRandom(uid, d)
|
||||
if len(info.Nb.Tasks) == 0 {
|
||||
tasks, err := a.module.modelDispatch.taskRandom(uid, info)
|
||||
if err != nil {
|
||||
|
||||
return
|
||||
@ -55,10 +59,10 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (
|
||||
}
|
||||
return
|
||||
}
|
||||
d.Nb = nb
|
||||
info.Nb = nb
|
||||
} else {
|
||||
//恢复门票
|
||||
one := utils.DiffDays(d.Nb.UpdateTime, configure.Now().Unix())
|
||||
one := utils.DiffDays(info.Nb.UpdateTime, configure.Now().Unix())
|
||||
if one >= 1 {
|
||||
itemId := a.module.ModuleTools.GetGlobalConf().DispatchNumtools.T
|
||||
left := a.module.ModuleItems.QueryItemAmount(uid, itemId)
|
||||
@ -76,17 +80,17 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (
|
||||
}
|
||||
}
|
||||
//周任务重置
|
||||
n := utils.DiffDays(d.Nb.UpdateTime, configure.Now().Unix())
|
||||
n := utils.DiffDays(info.Nb.UpdateTime, configure.Now().Unix())
|
||||
day := a.module.ModuleTools.GetGlobalConf().DispatchWeektaskcheck
|
||||
if int32(n) >= day {
|
||||
d.Nb.WeekCount = 0
|
||||
d.Nb.WeekReceived = []int32{}
|
||||
d.Nb.UpdateTime = configure.Now().Unix()
|
||||
info.Nb.WeekCount = 0
|
||||
info.Nb.WeekReceived = []int32{}
|
||||
info.Nb.UpdateTime = configure.Now().Unix()
|
||||
}
|
||||
a.module.modelDispatch.updateNotice(session.GetUserId(), d)
|
||||
a.module.modelDispatch.updateNotice(session.GetUserId(), info)
|
||||
}
|
||||
|
||||
rsp.Dispatch = d.Nb
|
||||
rsp.Dispatch = info.Nb
|
||||
session.SendMsg(string(a.module.GetType()), "notice", rsp)
|
||||
return
|
||||
}
|
||||
|
@ -20,21 +20,25 @@ func (a *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.DispatchReceiv
|
||||
}
|
||||
|
||||
func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
info *pb.DBDispatch
|
||||
err error
|
||||
)
|
||||
var res []*cfg.Gameatn
|
||||
if errdata = a.ReceiveCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if d == nil {
|
||||
|
||||
if info, err = a.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var flag bool
|
||||
for _, v := range d.Nb.Tasks {
|
||||
for _, v := range info.Nb.Tasks {
|
||||
if v.TaskId == req.TaskId {
|
||||
if v.Status == 2 {
|
||||
flag = true
|
||||
@ -51,12 +55,12 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
|
||||
return
|
||||
}
|
||||
|
||||
tasks, oldTask := a.module.modelDispatch.replaceTask(session.GetUserId(), req.TaskId, d)
|
||||
tasks, oldTask := a.module.modelDispatch.replaceTask(session.GetUserId(), req.TaskId, info)
|
||||
|
||||
//更新公告任务
|
||||
d.Nb.TaskCount++
|
||||
d.Nb.WeekCount++
|
||||
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), d.Nb, tasks); err != nil {
|
||||
info.Nb.TaskCount++
|
||||
info.Nb.WeekCount++
|
||||
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), info.Nb, tasks); err != nil {
|
||||
a.module.Debug("更新公告失败", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "taskId", Value: req.TaskId})
|
||||
return
|
||||
}
|
||||
@ -75,12 +79,12 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
|
||||
}
|
||||
a.module.DispenseRes(session, res, true)
|
||||
//记录任务使用次数
|
||||
if d.Completecount == nil {
|
||||
d.Completecount = make(map[int32]int32)
|
||||
if info.Completecount == nil {
|
||||
info.Completecount = make(map[int32]int32)
|
||||
}
|
||||
d.Completecount[req.TaskId] += 1
|
||||
info.Completecount[req.TaskId] += 1
|
||||
update := map[string]interface{}{
|
||||
"completecount": d.Completecount,
|
||||
"completecount": info.Completecount,
|
||||
}
|
||||
a.module.modelDispatch.Change(session.GetUserId(), update)
|
||||
}
|
||||
|
@ -17,12 +17,13 @@ func (this *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshR
|
||||
var (
|
||||
info *pb.DBDispatch
|
||||
need []*cfg.Gameatn
|
||||
err error
|
||||
)
|
||||
info = this.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if info == nil {
|
||||
|
||||
if info, err = this.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -18,18 +18,19 @@ func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWee
|
||||
|
||||
func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
res []*cfg.Gameatn
|
||||
info *pb.DBDispatch
|
||||
res []*cfg.Gameatn
|
||||
err error
|
||||
)
|
||||
if errdata = a.WeekreciveCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
rsp := &pb.DispatchWeekReciveResp{}
|
||||
|
||||
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||
if d == nil {
|
||||
if info, err = a.module.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DataNotFound,
|
||||
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -38,9 +39,9 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci
|
||||
wr := a.module.ModuleTools.GetGlobalConf().DispatchWeektaskreward
|
||||
for i, v := range wr {
|
||||
if req.Idx == int32(i+1) {
|
||||
if d.Nb.WeekCount >= v.N {
|
||||
if info.Nb.WeekCount >= v.N {
|
||||
//更新周任务状态
|
||||
if err := a.module.modelDispatch.updateWeekstatus(session.GetUserId(), req.Idx, d.Nb); err != nil {
|
||||
if err := a.module.modelDispatch.updateWeekstatus(session.GetUserId(), req.Idx, info.Nb); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
|
@ -32,15 +32,15 @@ func (this *modelDispatch) Init(service core.IService, module core.IModule, comp
|
||||
}
|
||||
|
||||
// 获取派遣数据
|
||||
func (this *modelDispatch) getDBDispatch(uid string) (dis *pb.DBDispatch) {
|
||||
func (this *modelDispatch) getDBDispatch(uid string) (dis *pb.DBDispatch, err error) {
|
||||
dis = &pb.DBDispatch{}
|
||||
if err := this.Get(uid, dis); err != nil {
|
||||
if err = this.Get(uid, dis); err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
dis.Uid = uid
|
||||
dis.Nb = &pb.Noticeboard{
|
||||
Lv: 1,
|
||||
}
|
||||
if err := this.Add(uid, dis); err != nil {
|
||||
if err = this.Add(uid, dis); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -217,20 +217,14 @@ func (this *modelDispatch) replaceFinishedTask(uid string, dispatch *pb.DBDispat
|
||||
}
|
||||
|
||||
// 验证英雄的条件
|
||||
func (this *modelDispatch) validHeroCond(uid string, taskId int32, heroId string) (ok1, ok2 bool, err error) {
|
||||
func (this *modelDispatch) validHeroCond(uid string, dispatch *pb.DBDispatch, taskId int32, hero *pb.DBHero) (ok1, ok2 bool, err error) {
|
||||
var (
|
||||
task *pb.DispatchTask
|
||||
)
|
||||
|
||||
//校验英雄是否已被派遣
|
||||
dispatch := this.getDBDispatch(uid)
|
||||
if dispatch == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range dispatch.Nb.Tasks {
|
||||
for _, h := range v.HeroIds {
|
||||
if h == heroId {
|
||||
if h == hero.Id {
|
||||
err = comm.NewCustomError(pb.ErrorCode_DispatchHeroAssigned)
|
||||
return
|
||||
}
|
||||
@ -253,36 +247,31 @@ func (this *modelDispatch) validHeroCond(uid string, taskId int32, heroId string
|
||||
return
|
||||
}
|
||||
|
||||
//获取英雄信息
|
||||
hero, code := this.module.ModuleHero.GetHeroByObjID(uid, heroId)
|
||||
|
||||
if code == nil && hero != nil {
|
||||
for _, v := range gd.Taskreq {
|
||||
if v.Key == 1 {
|
||||
if hero.Lv >= v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
} else if v.Key == 2 {
|
||||
if hero.Star >= v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
} else if v.Key == 3 {
|
||||
hcfg, err2 := this.module.configure.GetHeroConfig(hero.HeroID)
|
||||
if err2 != nil {
|
||||
return false, false, err2
|
||||
}
|
||||
if hcfg.Race == v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
for _, v := range gd.Taskreq {
|
||||
if v.Key == 1 {
|
||||
if hero.Lv >= v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
} else if v.Key == 2 {
|
||||
if hero.Star >= v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
} else if v.Key == 3 {
|
||||
hcfg, err2 := this.module.configure.GetHeroConfig(hero.HeroID)
|
||||
if err2 != nil {
|
||||
return false, false, err2
|
||||
}
|
||||
if hcfg.Race == v.Param {
|
||||
ok1 = true
|
||||
} else {
|
||||
ok1 = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,44 +284,23 @@ func (this *modelDispatch) validHeroCond(uid string, taskId int32, heroId string
|
||||
} else {
|
||||
ok2 = false
|
||||
}
|
||||
// for _, v := range gd.Taskreqex {
|
||||
// if v.Key == 1 {
|
||||
// if hero.Lv >= v.Param {
|
||||
// ok2 = true
|
||||
// } else {
|
||||
// ok2 = false
|
||||
// break
|
||||
// }
|
||||
// } else if v.Key == 2 {
|
||||
// if hero.Star >= v.Param {
|
||||
// ok2 = true
|
||||
// } else {
|
||||
// ok2 = false
|
||||
// break
|
||||
// }
|
||||
// } else if v.Key == 3 {
|
||||
// hcfg, err2 := this.module.configure.GetHeroConfig(hero.HeroID)
|
||||
// if err2 != nil {
|
||||
// return false, false, err2
|
||||
// }
|
||||
// if hcfg.Race == v.Param {
|
||||
// ok2 = true
|
||||
// } else {
|
||||
// ok2 = false
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 派遣
|
||||
func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string, disp *pb.DBDispatch) error {
|
||||
var flag bool //额外条件是否满足
|
||||
for _, heroId := range heroIds {
|
||||
if ok1, ok2, err := this.validHeroCond(uid, taskId, heroId); err == nil {
|
||||
func (this *modelDispatch) dispatch(session comm.IUserSession, info *pb.DBDispatch, taskId int32, heroIds []string) (err error) {
|
||||
var (
|
||||
flag bool //额外条件是否满足
|
||||
heros []*pb.DBHero
|
||||
)
|
||||
if heros, err = this.module.ModuleHero.QueryCrossMultipleHeroinfo(session.GetUserId(), heroIds); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
for _, hero := range heros {
|
||||
if ok1, ok2, err := this.validHeroCond(session.GetUserId(), info, taskId, hero); err == nil {
|
||||
if !ok1 {
|
||||
return comm.NewCustomError(pb.ErrorCode_DispatchHeroNoReached) //基础条件未满足
|
||||
}
|
||||
@ -344,7 +312,7 @@ func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string,
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range disp.Nb.Tasks {
|
||||
for _, v := range info.Nb.Tasks {
|
||||
if v.TaskId == taskId && v.Status == 0 {
|
||||
v.HeroIds = heroIds
|
||||
if v.Duration <= configure.Now().Unix() {
|
||||
@ -369,9 +337,9 @@ func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string,
|
||||
}
|
||||
|
||||
update := map[string]interface{}{
|
||||
"nb": disp.Nb,
|
||||
"nb": info.Nb,
|
||||
}
|
||||
if err := this.Change(uid, update); err != nil {
|
||||
if err := this.Change(session.GetUserId(), update); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
// 默认6条公告数量
|
||||
@ -38,3 +39,79 @@ func (this *Dispatch) OnInstallComp() {
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.modelDispatch = this.RegisterComp(new(modelDispatch)).(*modelDispatch)
|
||||
}
|
||||
|
||||
//红点查询
|
||||
func (this *Dispatch) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
|
||||
var (
|
||||
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot18105, comm.Reddot18112}
|
||||
info *pb.DBDispatch
|
||||
mintime int64
|
||||
err error
|
||||
ok bool
|
||||
)
|
||||
items = make(map[comm.ReddotType]*pb.ReddotItem)
|
||||
for _, v := range selfrid {
|
||||
if _, ok = rid[v]; ok {
|
||||
break
|
||||
}
|
||||
}
|
||||
if ok {
|
||||
return
|
||||
}
|
||||
if info, err = this.modelDispatch.getDBDispatch(session.GetUserId()); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
for _, v := range selfrid {
|
||||
if _, ok = rid[v]; ok {
|
||||
switch v {
|
||||
case comm.Reddot18105:
|
||||
ok = false
|
||||
for _, v := range info.Nb.Tasks {
|
||||
if v.Status == 1 {
|
||||
if mintime == 0 || mintime > v.Duration {
|
||||
mintime = v.Duration
|
||||
}
|
||||
}
|
||||
if v.Status == 2 {
|
||||
ok = true
|
||||
}
|
||||
}
|
||||
items[comm.Reddot18105] = &pb.ReddotItem{
|
||||
Rid: int32(comm.Reddot18105),
|
||||
Activated: ok,
|
||||
Nextchanagetime: mintime,
|
||||
}
|
||||
break
|
||||
case comm.Reddot18112:
|
||||
|
||||
//派发奖励
|
||||
wr := this.ModuleTools.GetGlobalConf().DispatchWeektaskreward
|
||||
for i, v := range wr {
|
||||
Idx := int32(i + 1)
|
||||
ok = false
|
||||
for _, v := range info.Nb.WeekReceived {
|
||||
if v == Idx {
|
||||
ok = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if info.Nb.WeekCount >= v.N {
|
||||
items[comm.Reddot18112] = &pb.ReddotItem{
|
||||
Rid: int32(comm.Reddot18112),
|
||||
Activated: true,
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user