This commit is contained in:
aozhiwei 2024-07-09 13:35:45 +08:00
parent 96117b773a
commit de378a8286
2 changed files with 39 additions and 3 deletions

View File

@ -1123,8 +1123,11 @@ class BattleController extends BaseAuthedController {
private function checkTicket($r, $customData, $mapModeMeta) private function checkTicket($r, $customData, $mapModeMeta)
{ {
if ($mapModeMeta['mapMode'] == 501) { if (!mt\MapMode::checkLimitTime($mapModeMeta)) {
error_log("checkTick error :501"); error_log(json_encode(array(
'msg' => 'MapMode::CheckLimitTime error',
'meta' => $mapModeMeta
)));
return false; return false;
} }
$itemId = $mapModeMeta['admission_item_id']; $itemId = $mapModeMeta['admission_item_id'];

View File

@ -1,8 +1,9 @@
<?php <?php
namespace mt; namespace mt;
require_once('mt/ServerTaskTime.php');
require_once('mt/RankSeason.php');
class MapMode class MapMode
{ {
@ -34,6 +35,38 @@ class MapMode
} }
} }
public static function checkLimitTime($meta)
{
switch (!$meta['limit_time']) {
case 1:
{
if ($meta['mapMode'] == self::RANKING_MODE) {
$currentSeasonMeta = RankSeason::getCurrentSeason();
if (empty($currentSeasonMeta)) {
return false;
}
}
}
break;
case 2:
{
if ($meta['mapMode'] == self::TREASURE_BOX_MODE) {
$currentServerTask = ServerTaskTime::getCurrentTime();
if (empty($currentServerTask)) {
return false;
}
}
}
break;
default:
{
return true;
}
break;
}
return true;
}
protected static function getMetaList() protected static function getMetaList()
{ {
if (!self::$metaList) { if (!self::$metaList) {