From 315cd9702d942960d7ec65a7b46418ec5dcaa802 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 16 Apr 2024 21:05:48 +0800 Subject: [PATCH] 1 --- webapp/bootstrap/constant.php | 1 + webapp/mt/MapMode.php | 6 ++++++ webapp/services/RoomBattleDataService.php | 11 +++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 609eee53..0f555358 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -66,6 +66,7 @@ define('TN_DAILY_BUY_PASS_STATE', 9017); define('TN_DAILY_BUY_LEVEL_STATE', 9018); define('TN_DAILY_RESET_HERO_LEVEL_STATE', 9019); define('TN_DAILY_REFRESH_MISSION_TIMES', 9020); +define('TN_DAILY_GOLD_MODE_BATTLE_TIMES', 9021); define('TN_WEEKLY_BEGIN', 10001); define('TN_WEEKLY_ACTIVE', 10002); diff --git a/webapp/mt/MapMode.php b/webapp/mt/MapMode.php index 13de153f..1512a099 100644 --- a/webapp/mt/MapMode.php +++ b/webapp/mt/MapMode.php @@ -6,6 +6,12 @@ namespace mt; class MapMode { + const PRACTICE_MODE = 101; + const GOLD_MODE = 201; + const BET_MODE = 301; + const RANKING_MODE = 401; + const TREASURE_BOX_MODE = 501; + public static function find($id){ return getXVal(self::getMetaList(), $id); } diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index 5dd921f1..9a96597b 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -148,8 +148,15 @@ class RoomBattleDataService extends BaseService { if (!$rewardMeta){ return ; } - //验证英雄是否有效期内 - if (Hero::verifyValid($heroDb)){ + $goldModeTimes = myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0); + if ($this->mapMode == mt\MapMode::GOLD_MODE){ + myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0,1); + } + //金币模式检验 + if ($this->mapMode == mt\MapMode::GOLD_MODE && + (!Hero::verifyValid($heroDb) || $goldModeTimes >= 25 )){ + error_log("金币模式:出战英雄没有打金时间或每日打金场次上限"); + }else{ if (!empty($rewardMeta['goldLoot'])){ $items = LootService::dropOutItem($rewardMeta['goldLoot']); foreach ($items as $item){