From 825889c8672748eec5b2778790d980df5d24f587 Mon Sep 17 00:00:00 2001 From: liwei Date: Mon, 31 Oct 2022 12:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pve=E6=B6=88=E8=80=97?= =?UTF-8?q?=E6=8C=91=E6=88=98=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/arena/api_challenge.go | 2 +- modules/arena/api_plot.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/arena/api_challenge.go b/modules/arena/api_challenge.go index 98b3edb99..3685f1b05 100644 --- a/modules/arena/api_challenge.go +++ b/modules/arena/api_challenge.go @@ -50,7 +50,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge cd = pb.ErrorCode_DBError return } - + this.module.modelArena.recoverTicket(red) if red.Ticket > 0 { red.Ticket-- if red.Lastrtickettime == 0 { diff --git a/modules/arena/api_plot.go b/modules/arena/api_plot.go index 191240431..9e451ecf0 100644 --- a/modules/arena/api_plot.go +++ b/modules/arena/api_plot.go @@ -56,6 +56,16 @@ func (this *apiComp) Plot(session comm.IUserSession, req *pb.ArenaPlotReq) (code cd = pb.ErrorCode_DBError return } + this.module.modelArena.recoverTicket(info) + if info.Ticket > 0 { + info.Ticket-- + if info.Lastrtickettime == 0 { + info.Lastrtickettime = time.Now().Unix() + } + } else { + code = pb.ErrorCode_ArenaTicketNotEnough + return + } if info.Npc[req.Pid] != nil { ndata := info.Npc[req.Pid] if !time.Now().After(time.Unix(ndata.Cd, 0)) { //已经过了cd时间