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_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
|
||||
|
@ -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),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user