updata
This commit is contained in:
parent
047ab5fb9d
commit
e5eb0d5b19
@ -27,6 +27,7 @@ func (this *apiComp) Activate(session comm.IUserSession, req *pb.AtlasActivateRe
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.CaravanGetListRe
|
||||
resp *pb.CaravanGetListResp
|
||||
)
|
||||
resp = &pb.CaravanGetListResp{}
|
||||
if code = this.GetListCheck(session, req); errdata != nil {
|
||||
if errdata = this.GetListCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
list, err := this.module.modelCaravan.getCaravanList(session.GetUserId())
|
||||
@ -27,14 +27,14 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.CaravanGetListRe
|
||||
if conf, err := this.module.configure.GetCaravanLv(list.Lv); err == nil {
|
||||
this.module.ModuleItems.CleanItemById(session, conf.Tickettop.T) // 清理之前的门票数据
|
||||
} else {
|
||||
data = &pb.ErrorData{
|
||||
Title: pb.GetErrorCodeMsg(code),
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if code = this.module.InitCaravanTicket(session, list.Lv); errdata != nil {
|
||||
if errdata = this.module.InitCaravanTicket(session, list.Lv); errdata != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -25,18 +25,18 @@ func (this *apiComp) GetStory(session comm.IUserSession, req *pb.CaravanGetStory
|
||||
)
|
||||
resp = &pb.CaravanGetStoryResp{}
|
||||
update = make(map[string]interface{})
|
||||
if code = this.GetStoryCheck(session, req); errdata != nil {
|
||||
if errdata = this.GetStoryCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
list, _ := this.module.modelCaravan.getCaravanList(session.GetUserId())
|
||||
|
||||
conf, err := this.module.configure.GetCaravanEventById(req.Cid)
|
||||
if err != nil {
|
||||
data = &pb.ErrorData{
|
||||
Title: pb.GetErrorCodeMsg(code),
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if list.Eventid != req.Cid {
|
||||
|
@ -26,7 +26,7 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
|
||||
)
|
||||
resp = &pb.CaravanGotoCityResp{}
|
||||
bNewTask = false
|
||||
if code = this.GotoCityCheck(session, req); errdata != nil {
|
||||
if errdata = this.GotoCityCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
list, _ := this.module.modelCaravan.getCaravanList(session.GetUserId())
|
||||
@ -38,18 +38,21 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
|
||||
if list.Tasktime-configure.Now().Unix() > int64(event.Eventtime) { //TODO 任务超时
|
||||
|
||||
}
|
||||
if event.Eventtype == 1 {
|
||||
code = pb.ErrorCode_TrollTask // 需要完成强制任务
|
||||
if event.Eventtype == 1 { // 需要完成强制任务
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_TrollTask,
|
||||
Title: pb.ErrorCode_TrollTask.ToString(),
|
||||
}
|
||||
return
|
||||
} else {
|
||||
bNewTask = false
|
||||
}
|
||||
} else {
|
||||
data = &pb.ErrorData{
|
||||
Title: pb.GetErrorCodeMsg(code),
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -82,14 +85,14 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
|
||||
N: req.Ticket,
|
||||
}
|
||||
} else {
|
||||
data = &pb.ErrorData{
|
||||
Title: pb.GetErrorCodeMsg(code),
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{res}, true); errdata != nil { // 校验门票数量
|
||||
if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{res}, true); errdata != nil { // 校验门票数量
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -114,12 +114,12 @@ func (this *Caravan) InitCaravanItemData(uid string, data *pb.DBCaravan) {
|
||||
|
||||
// 初始化门票和虚拟币
|
||||
func (this *Caravan) InitCaravanTicket(session comm.IUserSession, lv int32) (errdata *pb.ErrorData) {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
|
||||
if conf, _ := this.modelCaravan.module.configure.GetCaravanLv(lv); conf != nil {
|
||||
var res []*cfg.Gameatn
|
||||
res = append(res, conf.Tickettop)
|
||||
res = append(res, conf.Moneynumtop)
|
||||
code = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源
|
||||
errdata = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user