上传代码
This commit is contained in:
parent
360e73c9c8
commit
f38c02c383
@ -31,8 +31,13 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.EntertainGetList
|
|||||||
if !utils.IsToday(list.Rtime) {
|
if !utils.IsToday(list.Rtime) {
|
||||||
update := make(map[string]interface{})
|
update := make(map[string]interface{})
|
||||||
list.Rtime = configure.Now().Unix()
|
list.Rtime = configure.Now().Unix()
|
||||||
|
list.Playtype = []int32{}
|
||||||
|
var tmp []int32
|
||||||
for _, v := range this.module.configure.GetGameConsumeIntegral() {
|
for _, v := range this.module.configure.GetGameConsumeIntegral() {
|
||||||
list.Playtype = append(list.Playtype, v.Key) // 配置读取一个玩法
|
tmp = append(tmp, v.Key) // 配置读取一个玩法
|
||||||
|
}
|
||||||
|
for _, v := range comm.GetRandWs(tmp, 2) {
|
||||||
|
list.Playtype = append(list.Playtype, tmp[v])
|
||||||
}
|
}
|
||||||
list.Touxiang = 3 // 需求 默认3 后面可能走配置
|
list.Touxiang = 3 // 需求 默认3 后面可能走配置
|
||||||
update["touxiang"] = list.Touxiang // 每天投降次数清0
|
update["touxiang"] = list.Touxiang // 每天投降次数清0
|
||||||
|
@ -77,8 +77,8 @@ func (this *Entertainment) AddXxlCard(session comm.IUserSession, cards map[strin
|
|||||||
for k := range cards {
|
for k := range cards {
|
||||||
if _, err := this.model.module.configure.GetGameConsumeHero(k); err != nil {
|
if _, err := this.model.module.configure.GetGameConsumeHero(k); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -271,6 +271,14 @@ func (this *Entertainment) AddXxlSkillCard(session comm.IUserSession, skill map[
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for k, v := range skill {
|
for k, v := range skill {
|
||||||
|
if _, err := this.model.module.configure.GetGamePlaySkill(k); err != nil { // 参数校验
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
result.Skill[k] += v
|
result.Skill[k] += v
|
||||||
}
|
}
|
||||||
this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{
|
this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{
|
||||||
|
@ -307,16 +307,13 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
heroRecord.Cur = szCards
|
heroRecord.Cur = szCards
|
||||||
update["selectcount"] = heroRecord.Selectcount
|
update["selectcount"] = heroRecord.Selectcount
|
||||||
update["cur"] = heroRecord.Cur
|
update["cur"] = heroRecord.Cur
|
||||||
|
} else {
|
||||||
|
allres = append(allres, reward...)
|
||||||
|
if errdata, atno = this.module.DispenseAtno(session, allres, true); errdata != nil { //同意发送奖励
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
|
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
|
||||||
|
|
||||||
if req.DrawType != 1 {
|
|
||||||
allres = append(allres, reward...)
|
|
||||||
|
|
||||||
}
|
|
||||||
if errdata, atno = this.module.DispenseAtno(session, allres, true); errdata != nil { //同意发送奖励
|
|
||||||
return
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.module.GetType()), DrawCard, rsp)
|
session.SendMsg(string(this.module.GetType()), DrawCard, rsp)
|
||||||
|
|
||||||
if req.DrawType != 1 {
|
if req.DrawType != 1 {
|
||||||
|
@ -915,20 +915,20 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
|
|||||||
N: v,
|
N: v,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.Debugf("发放三消卡片资源资源: %v errdata: %v", xxl, errdata)
|
this.Debugf("发放三消英雄卡片资源资源: %v errdata: %v", xxl, errdata)
|
||||||
}
|
}
|
||||||
if len(xxlSkill) > 0 {
|
if len(xxlSkill) > 0 {
|
||||||
if errdata = this.ModuleEntertain.AddXxlSkillCard(session, xxlSkill, bPush); errdata != nil {
|
if errdata = this.ModuleEntertain.AddXxlSkillCard(session, xxlSkill, bPush); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for k, v := range xxl {
|
for k, v := range xxlSkill {
|
||||||
atno = append(atno, &pb.UserAtno{
|
atno = append(atno, &pb.UserAtno{
|
||||||
A: comm.TitleType,
|
A: comm.TitleType,
|
||||||
T: k,
|
T: k,
|
||||||
N: v,
|
N: v,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.Debugf("发放三消卡片资源资源: %v errdata: %v", xxl, errdata)
|
this.Debugf("发放三消技能卡片资源资源: %v errdata: %v", xxlSkill, errdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user