Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
059c9f40da
@ -338,8 +338,8 @@
|
|||||||
],
|
],
|
||||||
"run_horsetime1": 3,
|
"run_horsetime1": 3,
|
||||||
"run_horsetime2": 10,
|
"run_horsetime2": 10,
|
||||||
"boy_headPortrait": "tx_js_zj",
|
"boy_headPortrait": "ty_tx_nz",
|
||||||
"girl_headPortrait": "tx_js_zj",
|
"girl_headPortrait": "ty_tx_nz",
|
||||||
"namecolor": "#FFFF00",
|
"namecolor": "#FFFF00",
|
||||||
"skillGetLocation": [
|
"skillGetLocation": [
|
||||||
114
|
114
|
||||||
|
@ -26,7 +26,7 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
|
|||||||
|
|
||||||
chapter := this.module.modelOldtimes.getChatper(req.ChapterId, ot)
|
chapter := this.module.modelOldtimes.getChatper(req.ChapterId, ot)
|
||||||
if chapter != nil {
|
if chapter != nil {
|
||||||
if chapter.Status == 3 {
|
if chapter.Status == int32(finish) {
|
||||||
code = pb.ErrorCode_OldtimesFinished
|
code = pb.ErrorCode_OldtimesFinished
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -34,11 +34,11 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
|
|||||||
var exist bool
|
var exist bool
|
||||||
for _, l := range chapter.Levels {
|
for _, l := range chapter.Levels {
|
||||||
if l.Lid == req.LevelId {
|
if l.Lid == req.LevelId {
|
||||||
if l.Status == 3 {
|
if l.Status == int32(finish) {
|
||||||
code = pb.ErrorCode_OldtimesLevelOver
|
code = pb.ErrorCode_OldtimesLevelOver
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
l.Status = 2
|
l.Status = int32(ongoing)
|
||||||
}
|
}
|
||||||
exist = true
|
exist = true
|
||||||
break
|
break
|
||||||
@ -48,7 +48,7 @@ func (this *apiComp) Enter(session comm.IUserSession, req *pb.OldtimesEnterReq)
|
|||||||
if !exist {
|
if !exist {
|
||||||
chapter.Levels = append(chapter.Levels, &pb.Level{
|
chapter.Levels = append(chapter.Levels, &pb.Level{
|
||||||
Lid: req.LevelId,
|
Lid: req.LevelId,
|
||||||
Status: 1,
|
Status: int32(unlock),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (code pb.ErrorCode) {
|
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.OldtimesReceiveReq) (code pb.ErrorCode) {
|
||||||
|
if req.ChapterId <= 0 {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
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()
|
uid := session.GetUserId()
|
||||||
|
|
||||||
rsp := &pb.OldtimesReceiveResp{}
|
rsp := &pb.OldtimesReceiveResp{}
|
||||||
@ -20,7 +26,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR
|
|||||||
if v.Received == 1 {
|
if v.Received == 1 {
|
||||||
code = pb.ErrorCode_OldtimesReceived
|
code = pb.ErrorCode_OldtimesReceived
|
||||||
return
|
return
|
||||||
} else if v.Status != 3 {
|
} else if v.Status != int32(finish) {
|
||||||
code = pb.ErrorCode_OldtimesNoAllFinished
|
code = pb.ErrorCode_OldtimesNoAllFinished
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user