上传代码

This commit is contained in:
meixiongfeng 2024-01-04 16:47:11 +08:00
parent 360e73c9c8
commit f38c02c383
4 changed files with 24 additions and 14 deletions

View File

@ -31,8 +31,13 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.EntertainGetList
if !utils.IsToday(list.Rtime) {
update := make(map[string]interface{})
list.Rtime = configure.Now().Unix()
list.Playtype = []int32{}
var tmp []int32
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 后面可能走配置
update["touxiang"] = list.Touxiang // 每天投降次数清0

View File

@ -77,8 +77,8 @@ func (this *Entertainment) AddXxlCard(session comm.IUserSession, cards map[strin
for k := range cards {
if _, err := this.model.module.configure.GetGameConsumeHero(k); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
@ -271,6 +271,14 @@ func (this *Entertainment) AddXxlSkillCard(session comm.IUserSession, skill map[
return
}
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
}
this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{

View File

@ -307,16 +307,13 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
heroRecord.Cur = szCards
update["selectcount"] = heroRecord.Selectcount
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)
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)
if req.DrawType != 1 {

View File

@ -915,20 +915,20 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
N: v,
})
}
this.Debugf("发放三消卡片资源资源: %v errdata: %v", xxl, errdata)
this.Debugf("发放三消英雄卡片资源资源: %v errdata: %v", xxl, errdata)
}
if len(xxlSkill) > 0 {
if errdata = this.ModuleEntertain.AddXxlSkillCard(session, xxlSkill, bPush); errdata != nil {
return
}
for k, v := range xxl {
for k, v := range xxlSkill {
atno = append(atno, &pb.UserAtno{
A: comm.TitleType,
T: k,
N: v,
})
}
this.Debugf("发放三消卡片资源资源: %v errdata: %v", xxl, errdata)
this.Debugf("发放三消技能卡片资源资源: %v errdata: %v", xxlSkill, errdata)
}
return