From 1ee426fcbc36250b2b4993e0c5192d56962cab2c Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Tue, 11 Jul 2023 18:46:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=B0=B4=E6=99=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/passon/api_inroom.go | 4 ++++ modules/passon/api_outroom.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/passon/api_inroom.go b/modules/passon/api_inroom.go index c5cc7e197..704d4ba30 100644 --- a/modules/passon/api_inroom.go +++ b/modules/passon/api_inroom.go @@ -113,6 +113,10 @@ func (this *apiComp) InRoom(session comm.IUserSession, req *pb.PassonInRoomReq) if errdata = this.module.ModuleHero.PassonHero(session, map[string]bool{hero.Id: true}); errdata != nil { return } + + passon.Student[req.Index].State = 1 + passon.Student[req.Index].Heroid = hero.Id + if err = this.module.modelPasson.updateUserPasson(session.GetUserId(), passon); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, diff --git a/modules/passon/api_outroom.go b/modules/passon/api_outroom.go index 803fae63d..86ec35450 100644 --- a/modules/passon/api_outroom.go +++ b/modules/passon/api_outroom.go @@ -36,12 +36,12 @@ func (this *apiComp) OutRoom(session comm.IUserSession, req *pb.PassonOutRoomReq } return } - passon.Student[req.Index].State = 2 - passon.Student[req.Index].Cdtime = configure.Now().Unix() + if errdata = this.module.ModuleHero.PassonHero(session, map[string]bool{req.Heroid: false}); errdata != nil { return } - + passon.Student[req.Index].State = 2 + passon.Student[req.Index].Cdtime = configure.Now().Unix() if err = this.module.modelPasson.updateUserPasson(session.GetUserId(), passon); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError,