上传npc踢馆调整
This commit is contained in:
parent
e9a9f99b65
commit
8368c6d038
@ -3,6 +3,7 @@ package practice
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
@ -13,19 +14,19 @@ func (this *apiComp) NPCDialogCheck(session comm.IUserSession, req *pb.PracticeN
|
||||
|
||||
///npc 领取对白奖励
|
||||
func (this *apiComp) NPCDialog(session comm.IUserSession, req *pb.PracticeNPCDialogReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
||||
// var (
|
||||
// err error
|
||||
// room *pb.DBPracticeRoom
|
||||
// conf *cfg.GameDispatch_BattleData
|
||||
// )
|
||||
// if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
|
||||
// code = pb.ErrorCode_DBError
|
||||
// return
|
||||
// }
|
||||
// if room.Npcstate != 2 {
|
||||
// code = pb.ErrorCode_ReqParameterError
|
||||
// return
|
||||
// }
|
||||
var (
|
||||
err error
|
||||
room *pb.DBPracticeRoom
|
||||
// conf *cfg.GameDispatch_BattleData
|
||||
)
|
||||
if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if room.Npcstate != 2 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
// if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
|
||||
// code = pb.ErrorCode_ConfigNoFound
|
||||
// return
|
||||
@ -33,12 +34,12 @@ func (this *apiComp) NPCDialog(session comm.IUserSession, req *pb.PracticeNPCDia
|
||||
// if code = this.module.DispenseRes(session, conf.StoryAward, true); code != pb.ErrorCode_Success {
|
||||
// return
|
||||
// }
|
||||
// room.Npcstate = 3
|
||||
// room.Refresh = configure.Now().Unix()
|
||||
// this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
// "npcstate": room.Npcstate,
|
||||
// "refresh": room.Refresh,
|
||||
// })
|
||||
room.Npcstate = 3
|
||||
room.Refresh = configure.Now().Unix()
|
||||
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
"npcstate": room.Npcstate,
|
||||
"refresh": room.Refresh,
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "npcdialog", &pb.PracticeNPCDialogResp{Issucc: true})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user