1
This commit is contained in:
parent
4dbeb38df6
commit
3aba8b25c5
@ -13,6 +13,7 @@ require_once('models/Hero.php');
|
||||
require_once('models/Gun.php');
|
||||
|
||||
require_once('services/FormulaService.php');
|
||||
require_once('services/RankActivityService.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use mt;
|
||||
@ -86,9 +87,9 @@ class MissionService extends BaseService {
|
||||
'refreshtime' => 0
|
||||
);
|
||||
}
|
||||
if (myself()->_getNowTime() - $this->offerRewartdMission['refreshtime'] >= 86400){
|
||||
// if (myself()->_getNowTime() - $this->offerRewartdMission['refreshtime'] >= 86400){
|
||||
$this->refreshOfferRewardMission();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
public function getMissionDto($userInfo, $seasonDb, $missionDb, $missionMeta)
|
||||
@ -581,7 +582,9 @@ class MissionService extends BaseService {
|
||||
{
|
||||
$wantedRefreshMissionNum = mt\Parameter::getVal
|
||||
('wanted_refresh_mission_num', 0);
|
||||
|
||||
if (count($this->offerRewartdMission['missions']) >= 10){
|
||||
return;
|
||||
}
|
||||
if ($wantedRefreshMissionNum <=
|
||||
// count($this->offerRewartdMission['missions'])
|
||||
$this->getMissionsCount()
|
||||
@ -590,9 +593,9 @@ class MissionService extends BaseService {
|
||||
}
|
||||
$metas = mt\Task::getOfferRewardMissions
|
||||
($this->offerRewartdMission['missions']);
|
||||
// if (count($metas) < $wantedRefreshMissionNum) {
|
||||
// return;
|
||||
// }
|
||||
if (count($metas)<1) {
|
||||
return;
|
||||
}
|
||||
$count = count($metas)>=5 ? 5 : count($metas);
|
||||
foreach (array_rand($metas, $count) as $key) {
|
||||
$meta = $metas[$key];
|
||||
@ -600,6 +603,9 @@ class MissionService extends BaseService {
|
||||
$wantedRefreshMissionNum) {
|
||||
break;
|
||||
}
|
||||
if (count($this->offerRewartdMission['missions']) >= 10) {
|
||||
break;
|
||||
}
|
||||
if (!$this->inOfferRewardMission($meta['id'])) {
|
||||
array_push($this->offerRewartdMission['missions'],
|
||||
array(
|
||||
@ -1028,9 +1034,11 @@ class MissionService extends BaseService {
|
||||
}
|
||||
}//end foreach
|
||||
$ceg = $totalHeroUpLimit + $totalGunUpLimit;
|
||||
$rankActivityService = new RankActivityService();
|
||||
if ($count > 0 && $ceg > 0) {
|
||||
myself()->_addVirtualItem(V_ITEM_GOLD, round($ceg,2));
|
||||
$awardService->addItem(V_ITEM_GOLD, round($ceg,2));
|
||||
$rankActivityService->updateBattleData($ceg);
|
||||
}
|
||||
|
||||
if ($totalHeroUpLimit>0){
|
||||
|
@ -56,11 +56,13 @@ class RankActivityService extends BaseService {
|
||||
'ceg'=>$gold
|
||||
))
|
||||
);
|
||||
$ranked = getReqVal('ranked', 0);
|
||||
$kills = getReqVal('kills', 0);
|
||||
$aliveTime = getReqVal('alive_time', 0)/1000;
|
||||
if ($currentRankingMeta){
|
||||
switch ($currentRankingMeta['themeType']){
|
||||
case self::KILLS_TYPE :
|
||||
{
|
||||
$kills = getReqVal('kills', 0);
|
||||
if($kills>0){
|
||||
$this->internalUpdateRankActivityNew(
|
||||
$currentRankingMeta,
|
||||
@ -71,7 +73,6 @@ class RankActivityService extends BaseService {
|
||||
break;
|
||||
case self::WINS_TYPE :
|
||||
{
|
||||
$ranked = getReqVal('ranked', 0);
|
||||
if ($ranked == 1){
|
||||
$this->internalUpdateRankActivityNew(
|
||||
$currentRankingMeta,
|
||||
@ -82,6 +83,15 @@ class RankActivityService extends BaseService {
|
||||
break;
|
||||
case self::BATTLES_TYPE :
|
||||
{
|
||||
if (!$ranked) {
|
||||
return;
|
||||
}
|
||||
$cond = (1 - ($ranked > 30 ? 1 : 0) *
|
||||
($kills < 1 ? 1 : 0) *
|
||||
($aliveTime < 30 ? 1 : 0));
|
||||
if (!$cond) {
|
||||
return;
|
||||
}
|
||||
$this->internalUpdateRankActivityNew(
|
||||
$currentRankingMeta,
|
||||
1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user