1
This commit is contained in:
parent
fdec13f70a
commit
539b0676dd
@ -309,6 +309,7 @@ class BattleController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$roomBattleDataService->realUserCount = $realUserNum;
|
||||||
}
|
}
|
||||||
//排位模式计算个人排名
|
//排位模式计算个人排名
|
||||||
if ($roomBattleDataService->mapMode == mt\MapMode::RANKING_MODE){
|
if ($roomBattleDataService->mapMode == mt\MapMode::RANKING_MODE){
|
||||||
@ -328,7 +329,7 @@ class BattleController extends BaseAuthedController {
|
|||||||
return ($a['expScore'] > $b['expScore']) ? -1 : 1;
|
return ($a['expScore'] > $b['expScore']) ? -1 : 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$roomBattleDataService->realUserCount = $realUserNum;
|
|
||||||
foreach ($input["team_list"] as $teamData){
|
foreach ($input["team_list"] as $teamData){
|
||||||
$battle_uuid = getXVal($teamData,'battle_uuid', 0);
|
$battle_uuid = getXVal($teamData,'battle_uuid', 0);
|
||||||
$battleSettlementDb = BattleSettlement::findTeam($battle_uuid,$room_uuid);
|
$battleSettlementDb = BattleSettlement::findTeam($battle_uuid,$room_uuid);
|
||||||
|
@ -47,7 +47,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
|
|
||||||
|
|
||||||
public function settlementReward(){
|
public function settlementReward(){
|
||||||
error_log('settlementReward1');
|
error_log('settlementReward');
|
||||||
$realUserNum = 0;
|
$realUserNum = 0;
|
||||||
$myTeamScore = 0;
|
$myTeamScore = 0;
|
||||||
foreach ($this->teamData['members'] as $member){
|
foreach ($this->teamData['members'] as $member){
|
||||||
@ -57,13 +57,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$myTeamScoreAvg = $realUserNum > 0 ? $myTeamScore / $realUserNum : 0;
|
$myTeamScoreAvg = $realUserNum > 0 ? $myTeamScore / $realUserNum : 0;
|
||||||
// $paramMeta = mt\Parameter::getVal('performance_score_range',0);
|
|
||||||
// $scoreParam = explode("|",$paramMeta);
|
|
||||||
// if (count($paramMeta) < 2){
|
|
||||||
// error_log('Parameter table error');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// $room_mode = getXVal($this->inputData,'room_mode', 0);
|
|
||||||
$battleData = emptyReplace(json_decode($this->battleSettlementDb['data'], true), array());
|
$battleData = emptyReplace(json_decode($this->battleSettlementDb['data'], true), array());
|
||||||
if ($battleData['settlement_status'] == 1){
|
if ($battleData['settlement_status'] == 1){
|
||||||
error_log('Cannot be resettled');
|
error_log('Cannot be resettled');
|
||||||
@ -90,14 +83,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
$newRank=$userDb['rank'];
|
$newRank=$userDb['rank'];
|
||||||
$ranked = $this->getMyRanked($account);
|
$ranked = $this->getMyRanked($account);
|
||||||
$newScore = FormulaService::calcBattleAfterRankScoreNew($userDb,$ranked,$teamRanked,$winningPro);
|
$newScore = FormulaService::calcBattleAfterRankScoreNew($userDb,$ranked,$teamRanked,$winningPro);
|
||||||
if ($account == "6513_2006_VBpXS6ACSw6oqbEspB3N1ezsAty0IIvk"){
|
|
||||||
error_log("RankParam: ".json_encode(array(
|
|
||||||
'rank' => $ranked,
|
|
||||||
'teamRank' => $teamRanked,
|
|
||||||
'winningPro' => $winningPro,
|
|
||||||
"sortAccount" => $this->teamExpScoreSort
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
$newElo = FormulaService::calcUserEloValueNew($userDb,$ranked,$winningPro);
|
$newElo = FormulaService::calcUserEloValueNew($userDb,$ranked,$winningPro);
|
||||||
if ($newScore < $userDb['score'] && $userDb['score']< 1300){
|
if ($newScore < $userDb['score'] && $userDb['score']< 1300){
|
||||||
$newScore = $userDb['score'];
|
$newScore = $userDb['score'];
|
||||||
@ -160,7 +145,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function _getBattleRewards($userDb,$heroDb,$battleScore,$teamScoreAvg,$teamScore,&$reward){
|
public function _getBattleRewards($userDb,$heroDb,$battleScore,$teamScoreAvg,$teamScore,&$reward){
|
||||||
error_log('settlementReward : _getBattleRewards');
|
error_log('settlementReward -> _getBattleRewards');
|
||||||
$mapModeMeta = mt\MapMode::findByMapMode($this->mapMode);
|
$mapModeMeta = mt\MapMode::findByMapMode($this->mapMode);
|
||||||
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
||||||
if ($mapModeMeta){
|
if ($mapModeMeta){
|
||||||
@ -190,12 +175,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
(!Hero::verifyValid($heroDb) || $heroTimes >= $heroTimesMax || $goldModeTimes >= $mapModeMeta['rewards_max_time'])){
|
(!Hero::verifyValid($heroDb) || $heroTimes >= $heroTimesMax || $goldModeTimes >= $mapModeMeta['rewards_max_time'])){
|
||||||
error_log("金币模式:出战英雄没有打金时间或每日打金场次上限");
|
error_log("金币模式:出战英雄没有打金时间或每日打金场次上限");
|
||||||
}else{
|
}else{
|
||||||
error_log('settlementReward : star');
|
|
||||||
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
|
||||||
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,(int)$heroDb['idx'],1);
|
|
||||||
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0,1);
|
|
||||||
}
|
|
||||||
error_log('settlementReward : test1');
|
|
||||||
if (!empty($rewardMeta['goldLoot'])){
|
if (!empty($rewardMeta['goldLoot'])){
|
||||||
$items = LootService::dropOutItem($rewardMeta['goldLoot']);
|
$items = LootService::dropOutItem($rewardMeta['goldLoot']);
|
||||||
foreach ($items as $item){
|
foreach ($items as $item){
|
||||||
@ -207,7 +186,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error_log('settlementReward : test2');
|
|
||||||
if ($gold > 0){
|
if ($gold > 0){
|
||||||
// $strArr = explode("|",$rewardMeta['goldParam']);
|
// $strArr = explode("|",$rewardMeta['goldParam']);
|
||||||
$coefficientArr = explode(";",$rewardMeta['goldParam']);
|
$coefficientArr = explode(";",$rewardMeta['goldParam']);
|
||||||
@ -219,54 +197,57 @@ class RoomBattleDataService extends BaseService {
|
|||||||
$gold = floor($gold * $this->realUserCount * $coefficient * ($battleScore / $teamScore));
|
$gold = floor($gold * $this->realUserCount * $coefficient * ($battleScore / $teamScore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error_log('settlementReward : test3');
|
|
||||||
//财富值加成
|
|
||||||
$wealthK = mt\Parameter::getVal('economy_hero_wealth_K',0);
|
|
||||||
$wealthE = mt\Parameter::getVal('economy_hero_wealth_E',0);
|
|
||||||
$wealthRate = $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK));
|
|
||||||
$gold = floor( $gold * (1 + $wealthRate));
|
|
||||||
// $wealthValue = round($wealthRate,4);
|
|
||||||
//基础金币获得
|
|
||||||
$baseValue = $gold;
|
$baseValue = $gold;
|
||||||
error_log('settlementReward : test4');
|
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
||||||
//算力加成
|
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,(int)$heroDb['idx'],1);
|
||||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0,1);
|
||||||
if ($currentPeriod && myself()->_getNowTime() >= strtotime($currentPeriod['income_start_time'])){
|
//财富值加成
|
||||||
$lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1);
|
$wealthK = mt\Parameter::getVal('economy_hero_wealth_K',0);
|
||||||
$currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']);
|
$wealthE = mt\Parameter::getVal('economy_hero_wealth_E',0);
|
||||||
$s = mt\Parameter::getVal('economy_account_compute_s',0);
|
$wealthRate = $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK));
|
||||||
$totalCompute = $currentCompute + $s * $lastCompute;
|
$gold = floor( $gold * (1 + $wealthRate));
|
||||||
$computeParam = mt\Parameter::getVal('economy_account_compute_K',0);
|
// $wealthValue = round($wealthRate,4);
|
||||||
$computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0);
|
//基础金币获得
|
||||||
$powerRate = $totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect;
|
$baseValue = $gold;
|
||||||
$gold = floor($gold * ($powerRate + 1));
|
//算力加成
|
||||||
$compute = ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1);
|
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||||
|
if ($currentPeriod && myself()->_getNowTime() >= strtotime($currentPeriod['income_start_time'])){
|
||||||
|
$lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1);
|
||||||
|
$currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']);
|
||||||
|
$s = mt\Parameter::getVal('economy_account_compute_s',0);
|
||||||
|
$totalCompute = $currentCompute + $s * $lastCompute;
|
||||||
|
$computeParam = mt\Parameter::getVal('economy_account_compute_K',0);
|
||||||
|
$computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0);
|
||||||
|
$powerRate = $totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect;
|
||||||
|
$gold = floor($gold * ($powerRate + 1));
|
||||||
|
$compute = ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1);
|
||||||
|
|
||||||
$hashRateValue = round($powerRate,4);
|
$hashRateValue = round($powerRate,4);
|
||||||
}
|
}
|
||||||
error_log('settlementReward : test5');
|
if ($userDb['account_id'] == "6517_2006_s1_0_104162729566475397176"){
|
||||||
if ($userDb['account_id'] == "6517_2006_s1_0_104162729566475397176"){
|
error_log("BattleGoldRecord:".json_encode(array(
|
||||||
error_log("BattleGoldRecord:".json_encode(array(
|
'goldLootIndex' => $rewardMeta['goldLoot'],
|
||||||
'goldLootIndex' => $rewardMeta['goldLoot'],
|
'map_mode' => $this->mapMode,
|
||||||
'map_mode' => $this->mapMode,
|
'*baseGold*' => $baseGold,
|
||||||
'*baseGold*' => $baseGold,
|
'teamRank' => $teamRank,
|
||||||
'teamRank' => $teamRank,
|
'*ranking*' => isset($coefficient) ? $coefficient : '空',
|
||||||
'*ranking*' => isset($coefficient) ? $coefficient : '空',
|
'battleScore' => $battleScore,
|
||||||
'battleScore' => $battleScore,
|
'realUserCount' => $this->realUserCount,
|
||||||
'realUserCount' => $this->realUserCount,
|
'teamScoreTotal' => $teamScore,
|
||||||
'teamScoreTotal' => $teamScore,
|
'teamScoreAvg' => $teamScoreAvg,
|
||||||
'teamScoreAvg' => $teamScoreAvg,
|
'*score*' => '=========',
|
||||||
'*score*' => '=========',
|
'wealthK' => $wealthK,
|
||||||
'wealthK' => $wealthK,
|
'wealthE' => $wealthE,
|
||||||
'wealthE' => $wealthE,
|
'wealthValue' => Hero::getHeroWealth($heroDb),
|
||||||
'wealthValue' => Hero::getHeroWealth($heroDb),
|
'*wealth*' => (1 + $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK))),
|
||||||
'*wealth*' => (1 + $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK))),
|
'lastCompute' => isset($lastCompute) ? $lastCompute : '空',
|
||||||
'lastCompute' => isset($lastCompute) ? $lastCompute : '空',
|
'currentCompute' => isset($currentCompute) ? $currentCompute : '空',
|
||||||
'currentCompute' => isset($currentCompute) ? $currentCompute : '空',
|
'*compute*' => isset($compute) ? $compute : '算力系统关闭',
|
||||||
'*compute*' => isset($compute) ? $compute : '算力系统关闭',
|
'finalGold' => floor($gold)
|
||||||
'finalGold' => floor($gold)
|
)));
|
||||||
)));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($gold > 0){
|
if ($gold > 0){
|
||||||
array_push($reward,array(
|
array_push($reward,array(
|
||||||
"item_id" => V_ITEM_GOLD,
|
"item_id" => V_ITEM_GOLD,
|
||||||
@ -278,7 +259,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
myself()->_incDailyV(TN_DAILY_GATHER_GOLD,0,floor($gold));
|
myself()->_incDailyV(TN_DAILY_GATHER_GOLD,0,floor($gold));
|
||||||
error_log('settlementReward : test6');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +275,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error_log('settlementReward : end'.'box-'.$rate);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user