From 31c754c27c6bfb069da9e0629bc2b372abc21945 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 29 Jun 2023 14:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E5=9C=BA=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E7=89=B9=E6=9D=83=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 19 ++++++++++--------- modules/arena/modelarena.go | 5 ++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/comm/const.go b/comm/const.go index 59804c587..2a3a5d470 100644 --- a/comm/const.go +++ b/comm/const.go @@ -844,15 +844,16 @@ const ( ) const ( - PrivilegeType1 = iota + 1 //每日获得 - PrivilegeType2 //金币商店每日免费刷新次数 - PrivilegeType3 //维京远征每日可购买挑战次数 - PrivilegeType4 //狩猎每日可购买挑战次数 - PrivilegeType5 //竞技场每日可购买挑战次数 - PrivilegeType6 //梦境每日可购买挑战次数 - PrivilegeType7 //巨怪商队背包容量 - PrivilegeType8 //美食馆每日最大制作时间 - PrivilegeType9 //武馆每日最大练功时间 + PrivilegeType1 = iota + 1 //每日获得 + PrivilegeType2 //金币商店每日免费刷新次数 + PrivilegeType3 //维京远征每日可购买挑战次数 + PrivilegeType4 //狩猎每日可购买挑战次数 + PrivilegeType5 //竞技场每日可购买挑战次数 + PrivilegeType6 //梦境每日可购买挑战次数 + PrivilegeType7 //巨怪商队背包容量 + PrivilegeType8 //美食馆每日最大制作时间 + PrivilegeType9 //武馆每日最大练功时间 + PrivilegeType10 //竞技场门票存储上限 ) const ( diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index c891c1956..e54363a8f 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -426,8 +426,11 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren } global := this.module.ModuleTools.GetGlobalConf() + maxTick := global.ArenaTicketMax + // 竞技场最大上限 + maxTick += this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType10) // 特权 ticket = int32(this.module.ModuleItems.QueryItemAmount(info.Uid, ticketitem.T)) - if ticket < global.ArenaTicketMax && info.Lastrtickettime > 0 { + if ticket < maxTick && info.Lastrtickettime > 0 { duration = configure.Now().Sub(time.Unix(info.Lastrtickettime, 0)) ticketNum = int32(math.Floor(duration.Minutes() / float64(global.ArenaTicketRecoveryTime))) if ticketNum > 0 {