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