Merge branches 'dev' and 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
liwei1dao 2023-04-19 20:20:19 +08:00
commit 4fceb5f841
3 changed files with 24 additions and 25 deletions

View File

@ -34,7 +34,7 @@ func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.Practic
}
if req.Report.WinSide == 1 {
room.Npcstate = 2
room.Npcstate = 3
if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
code = pb.ErrorCode_ConfigNoFound
return

View File

@ -3,7 +3,6 @@ package practice
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
)
//参数校验
@ -14,32 +13,32 @@ 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
}
// if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
// code = pb.ErrorCode_ConfigNoFound
// 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 code = this.module.DispenseRes(session, conf.StoryAward, true); code != pb.ErrorCode_Success {
// if room.Npcstate != 2 {
// code = pb.ErrorCode_ReqParameterError
// return
// }
room.Npcstate = 3
room.Refresh = configure.Now().Unix()
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
"npcstate": room.Npcstate,
"refresh": room.Refresh,
})
// // 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
}

View File

@ -413,7 +413,7 @@ func (this *Practice) CleanUpNpc(uid string) {
}
result.Refresh = configure.Now().Unix()
this.modelPandata.Change(uid, map[string]interface{}{ // 同步状态即可
model.Change(uid, map[string]interface{}{ // 同步状态即可
"npcstate": 3,
"refresh": result.Refresh,
})