临时去掉循环塔 赛季塔 开启条件
This commit is contained in:
parent
29e0cdda57
commit
2c714293c8
@ -16,7 +16,7 @@ const (
|
|||||||
PagodaActivateResp = "activate"
|
PagodaActivateResp = "activate"
|
||||||
PagodaWarOrderResp = "warorder"
|
PagodaWarOrderResp = "warorder"
|
||||||
PagodaChallengeRaceResp = "challengerace"
|
PagodaChallengeRaceResp = "challengerace"
|
||||||
PagodaChallengeRaceOverResp = "challengeoverrace"
|
PagodaChallengeRaceOverResp = "challengeraceover"
|
||||||
PagodaGetRaceResp = "getrace"
|
PagodaGetRaceResp = "getrace"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) CallengeRaceCheck(session comm.IUserSession, req *pb.PagodaChallengeRaceReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) ChallengeRaceCheck(session comm.IUserSession, req *pb.PagodaChallengeRaceReq) (errdata *pb.ErrorData) {
|
||||||
if req.Cid <= 0 {
|
if req.Cid <= 0 {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
@ -19,13 +19,13 @@ func (this *apiComp) CallengeRaceCheck(session comm.IUserSession, req *pb.Pagoda
|
|||||||
}
|
}
|
||||||
|
|
||||||
///阵营塔开始挑战
|
///阵营塔开始挑战
|
||||||
func (this *apiComp) CallengeRace(session comm.IUserSession, req *pb.PagodaChallengeRaceReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChallengeRaceReq) (errdata *pb.ErrorData) {
|
||||||
var (
|
var (
|
||||||
pagoda *pb.DBPagodaRace
|
pagoda *pb.DBPagodaRace
|
||||||
err error
|
err error
|
||||||
timeCheckOk bool
|
//timeCheckOk bool
|
||||||
)
|
)
|
||||||
if errdata = this.CallengeRaceCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeRaceCheck(session, req); errdata != nil {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,23 +40,23 @@ func (this *apiComp) CallengeRace(session comm.IUserSession, req *pb.PagodaChall
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断开启时间
|
// 判断开启时间
|
||||||
curWeekDay := int32(configure.Now().Weekday())
|
// curWeekDay := int32(configure.Now().Weekday())
|
||||||
if curWeekDay == 0 {
|
// if curWeekDay == 0 {
|
||||||
curWeekDay = 7
|
// curWeekDay = 7
|
||||||
}
|
// }
|
||||||
for _, v := range conf.Openingtime {
|
// for _, v := range conf.Openingtime {
|
||||||
if v == curWeekDay {
|
// if v == curWeekDay {
|
||||||
timeCheckOk = true
|
// timeCheckOk = true
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if !timeCheckOk {
|
// if !timeCheckOk {
|
||||||
errdata = &pb.ErrorData{
|
// errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_PagodaTimeError,
|
// Code: pb.ErrorCode_PagodaTimeError,
|
||||||
Title: pb.ErrorCode_PagodaTimeError.ToString(),
|
// Title: pb.ErrorCode_PagodaTimeError.ToString(),
|
||||||
}
|
// }
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
pagoda, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
pagoda, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
|
@ -21,12 +21,12 @@ func (this *apiComp) ChallengeRaceOverCheck(session comm.IUserSession, req *pb.P
|
|||||||
///挑战主线关卡
|
///挑战主线关卡
|
||||||
func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.PagodaChallengeRaceOverReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.PagodaChallengeRaceOverReq) (errdata *pb.ErrorData) {
|
||||||
var (
|
var (
|
||||||
mapData map[string]interface{}
|
mapData map[string]interface{}
|
||||||
race *pb.DBPagodaRace
|
race *pb.DBPagodaRace
|
||||||
isWin bool
|
isWin bool
|
||||||
err error
|
err error
|
||||||
atno []*pb.UserAtno // 通关奖励
|
atno []*pb.UserAtno // 通关奖励
|
||||||
timeCheckOk bool // 开启条件校验
|
//timeCheckOk bool // 开启条件校验
|
||||||
)
|
)
|
||||||
mapData = make(map[string]interface{}, 0)
|
mapData = make(map[string]interface{}, 0)
|
||||||
if errdata = this.ChallengeRaceOverCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeRaceOverCheck(session, req); errdata != nil {
|
||||||
@ -44,23 +44,23 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断开启时间
|
// 判断开启时间
|
||||||
curWeekDay := int32(configure.Now().Weekday())
|
// curWeekDay := int32(configure.Now().Weekday())
|
||||||
if curWeekDay == 0 {
|
// if curWeekDay == 0 {
|
||||||
curWeekDay = 7
|
// curWeekDay = 7
|
||||||
}
|
// }
|
||||||
for _, v := range conf.Openingtime {
|
// for _, v := range conf.Openingtime {
|
||||||
if v == curWeekDay {
|
// if v == curWeekDay {
|
||||||
timeCheckOk = true
|
// timeCheckOk = true
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if !timeCheckOk {
|
// if !timeCheckOk {
|
||||||
errdata = &pb.ErrorData{
|
// errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_PagodaTimeError,
|
// Code: pb.ErrorCode_PagodaTimeError,
|
||||||
Title: pb.ErrorCode_PagodaTimeError.ToString(),
|
// Title: pb.ErrorCode_PagodaTimeError.ToString(),
|
||||||
}
|
// }
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
race, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
race, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -127,16 +127,23 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
|
|||||||
}
|
}
|
||||||
|
|
||||||
race.Race[conf.Restriction].Curfloor += 1
|
race.Race[conf.Restriction].Curfloor += 1
|
||||||
|
race.Race[conf.Restriction].Defeat += 1
|
||||||
race.Race[conf.Restriction].Task = conf.Fightevents
|
race.Race[conf.Restriction].Task = conf.Fightevents
|
||||||
mapData["race"] = race.Race
|
mapData["race"] = race.Race
|
||||||
|
|
||||||
errdata = this.module.ModifyPagodaData(session.GetUserId(), mapData)
|
if err = this.module.modelRacePagoda.ModifyPagodaRaceDataByObjId(session.GetUserId(), mapData); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
}
|
||||||
// 通关奖励
|
// 通关奖励
|
||||||
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
|
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), PagodaChallengeRaceOverResp, &pb.PagodaChallengeRaceOverResp{
|
session.SendMsg(string(this.module.GetType()), PagodaChallengeRaceOverResp, &pb.PagodaChallengeRaceOverResp{
|
||||||
Race: race.Race[0],
|
Race: race.Race[conf.Restriction],
|
||||||
Reward: atno,
|
Reward: atno,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ func (this *ModelRace) getPagodaRaceList(uid string) (result *pb.DBPagodaRace, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改爬塔数据信息
|
// 修改爬塔数据信息
|
||||||
func (this *ModelRace) modifyPagodaRaceDataByObjId(uid string, data map[string]interface{}) error {
|
func (this *ModelRace) ModifyPagodaRaceDataByObjId(uid string, data map[string]interface{}) error {
|
||||||
return this.Change(uid, data)
|
return this.Change(uid, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user