Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8f75f5a770
@ -25,9 +25,9 @@ func (this *apiComp) GetStoryRewardCheck(session comm.IUserSession, req *pb.Libr
|
||||
func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGetStoryRewardReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
update map[string]interface{}
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
update = make(map[string]interface{}, 0)
|
||||
resp := &pb.LibraryGetStoryRewardResp{}
|
||||
if errdata = this.GetStoryRewardCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
@ -82,7 +82,7 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
if errdata = this.module.DispenseRes(session, res, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, res, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
@ -102,8 +102,9 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
|
||||
_heroFetter.History = append(_heroFetter.History, req.History)
|
||||
update["history"] = _heroFetter.History
|
||||
this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroFetter.Id, update)
|
||||
resp.Data = _heroFetter
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), LibraryGetStoryRewardResp, resp)
|
||||
session.SendMsg(string(this.module.GetType()), LibraryGetStoryRewardResp, &pb.LibraryGetStoryRewardResp{
|
||||
Data: _heroFetter,
|
||||
Reward: atno,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -23,8 +23,9 @@ func (this *apiComp) LvRewardCheck(session comm.IUserSession, req *pb.LibraryLvR
|
||||
|
||||
// 英雄回礼
|
||||
func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvRewardReq) (errdata *pb.ErrorData) {
|
||||
|
||||
resp := &pb.LibraryLvRewardResp{}
|
||||
var (
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
if errdata = this.LvRewardCheck(session, req); errdata != nil {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
@ -59,15 +60,17 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward
|
||||
|
||||
_heroFetter.Lvprize[req.Lv] = 1
|
||||
// 发奖
|
||||
if errdata = this.module.DispenseRes(session, confData.ReturnReward, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, confData.ReturnReward, true); errdata != nil {
|
||||
this.module.Errorf("GetStoryReward err:add item : %v", confData.ReturnReward)
|
||||
return
|
||||
}
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["lvprize"] = _heroFetter.Lvprize
|
||||
this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroFetter.Id, mapData)
|
||||
resp.Data = _heroFetter
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), LibraryLvRewardResp, resp)
|
||||
session.SendMsg(string(this.module.GetType()), LibraryLvRewardResp, &pb.LibraryLvRewardResp{
|
||||
Data: _heroFetter,
|
||||
Reward: atno,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -18,6 +18,10 @@ func (this *apiComp) TaskAwardCheck(session comm.IUserSession, req *pb.SmithyTas
|
||||
}
|
||||
|
||||
func (this *apiComp) TaskAward(session comm.IUserSession, req *pb.SmithyTaskAwardReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
|
||||
if errdata = this.TaskAwardCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
@ -39,9 +43,6 @@ func (this *apiComp) TaskAward(session comm.IUserSession, req *pb.SmithyTaskAwar
|
||||
}
|
||||
return
|
||||
}
|
||||
resp := &pb.SmithyTaskAwardResp{
|
||||
TaskId: req.TaskId,
|
||||
}
|
||||
if conf, err := this.module.configure.GetSmithyTask(req.TaskId); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
@ -50,11 +51,14 @@ func (this *apiComp) TaskAward(session comm.IUserSession, req *pb.SmithyTaskAwar
|
||||
}
|
||||
return
|
||||
} else {
|
||||
if errdata = this.module.DispenseRes(session, conf.Reword, true); errdata != nil {
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Reword, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "taskaward", resp)
|
||||
session.SendMsg(string(this.module.GetType()), "taskaward", &pb.SmithyTaskAwardResp{
|
||||
TaskId: req.TaskId,
|
||||
Reward: atno,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user