46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
package practice
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
"go_dreamfactory/sys/configure"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) NPCDialogCheck(session comm.IUserSession, req *pb.PracticeNPCDialogReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///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
|
|
}
|
|
// if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
|
|
// code = pb.ErrorCode_ConfigNoFound
|
|
// return
|
|
// }
|
|
// 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,
|
|
})
|
|
session.SendMsg(string(this.module.GetType()), "npcdialog", &pb.PracticeNPCDialogResp{Issucc: true})
|
|
return
|
|
}
|