This commit is contained in:
aozhiwei 2024-10-09 10:40:37 +08:00
parent 7b8beb94fb
commit 6dd6e74b53

View File

@ -6,6 +6,7 @@ require_once('mt/Parameter.php');
require_once('mt/MapMode.php'); require_once('mt/MapMode.php');
use mt; use mt;
use phpcommon\SqlHelper;
/* /*
1、周期还害没结束,箱子就掉完了 1、周期还害没结束,箱子就掉完了
完成度=T max/T cost time(last time-start time) 完成度=T max/T cost time(last time-start time)
@ -85,7 +86,7 @@ class BattleBoxService {
$allocableNum = min(5000, $maxNum * $completionDegree); $allocableNum = min(5000, $maxNum * $completionDegree);
} }
if ($allocableNum) { if ($allocableNum) {
self::setDailyPhaseAllocNum($currPhase, $allocableNum); self::setDailyPhaseAllocNum($currPhase, myself()->_getNowDaySeconds(), $allocableNum);
} }
} }
if ($allocableNum > 0) { if ($allocableNum > 0) {
@ -99,7 +100,7 @@ class BattleBoxService {
} }
if ($boxNum > 0) { if ($boxNum > 0) {
SqlHelper::insert( SqlHelper::insert(
$this->_getSelfMysql(), myself()->_getSelfMysql(),
't_box_alloc', 't_box_alloc',
array( array(
'room_uuid' => $roomUuid, 'room_uuid' => $roomUuid,
@ -145,14 +146,14 @@ class BattleBoxService {
$r->setPx($key, $val, 1000 * 3600 * 24 * 7); $r->setPx($key, $val, 1000 * 3600 * 24 * 7);
} }
private static function setDailyPhaseDropTotalNum($phase, $time) private static function setDailyPhaseDropTotalNum($phase, $time, $val)
{ {
$key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . $time; $key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . $time;
$r = myself()->_getRedis($key); $r = myself()->_getRedis($key);
$r->setPx($key, $val, 1000 * 3600 * 24 * 7); $r->setPx($key, $val, 1000 * 3600 * 24 * 7);
} }
private static function setDailyPhaseAllocNum($phase, $time) private static function setDailyPhaseAllocNum($phase, $time, $val)
{ {
$key = self::DAILY_PHASE_ALLOC_NUM_KEY . $phase . ':' . $time; $key = self::DAILY_PHASE_ALLOC_NUM_KEY . $phase . ':' . $time;
$r = myself()->_getRedis($key); $r = myself()->_getRedis($key);