This commit is contained in:
meixiongfeng 2023-04-26 13:42:50 +08:00
commit 059c9f40da
3 changed files with 13 additions and 7 deletions

View File

@ -338,8 +338,8 @@
],
"run_horsetime1": 3,
"run_horsetime2": 10,
"boy_headPortrait": "tx_js_zj",
"girl_headPortrait": "tx_js_zj",
"boy_headPortrait": "ty_tx_nz",
"girl_headPortrait": "ty_tx_nz",
"namecolor": "#FFFF00",
"skillGetLocation": [
114

View File

@ -26,7 +26,7 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
chapter := this.module.modelOldtimes.getChatper(req.ChapterId, ot)
if chapter != nil {
if chapter.Status == 3 {
if chapter.Status == int32(finish) {
code = pb.ErrorCode_OldtimesFinished
return
}
@ -34,11 +34,11 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
var exist bool
for _, l := range chapter.Levels {
if l.Lid == req.LevelId {
if l.Status == 3 {
if l.Status == int32(finish) {
code = pb.ErrorCode_OldtimesLevelOver
return
} else {
l.Status = 2
l.Status = int32(ongoing)
}
exist = true
break
@ -48,7 +48,7 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
if !exist {
chapter.Levels = append(chapter.Levels, &pb.Level{
Lid: req.LevelId,
Status: 1,
Status: int32(unlock),
})
}
}

View File

@ -6,10 +6,16 @@ import (
)
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (code pb.ErrorCode) {
if req.ChapterId <= 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveReq) (code pb.ErrorCode, data *pb.ErrorData) {
if code = this.ReceiveCheck(session,req);code!=pb.ErrorCode_Success{
return
}
uid := session.GetUserId()
rsp := &pb.OldtimesReceiveResp{}
@ -20,7 +26,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR
if v.Received == 1 {
code = pb.ErrorCode_OldtimesReceived
return
} else if v.Status != 3 {
} else if v.Status != int32(finish) {
code = pb.ErrorCode_OldtimesNoAllFinished
return
} else {