This commit is contained in:
hujiabin 2022-10-25 21:45:39 +08:00
parent 3d2d674132
commit 980c3ea6d7

View File

@ -66,7 +66,6 @@ class BattleDataService extends BaseService {
private $weapon1Dto = null; private $weapon1Dto = null;
private $weapon2Dto = null; private $weapon2Dto = null;
private $currSeasonMeta = null; private $currSeasonMeta = null;
private $oldScore = null;
private $reward = array( private $reward = array(
'hero' => array( 'hero' => array(
@ -148,8 +147,8 @@ class BattleDataService extends BaseService {
} }
} }
//录入战斗记录
$this->saveBattleHistory();
switch ($matchMode) { switch ($matchMode) {
case self::MATCH_MODE_PVP: case self::MATCH_MODE_PVP:
@ -185,12 +184,14 @@ class BattleDataService extends BaseService {
} }
break; break;
} }
//录入战斗记录
$this->saveBattleHistory();
} }
private function saveBattleHistory(){ private function saveBattleHistory(){
$user = myself()->_getOrmUserInfo(); $user = myself()->_getOrmUserInfo();
$newRank = $user['rank'];
$newScore = FormulaService::calcBattleAfterRankScore($user,$_REQUEST); //赛后排位积分
mt\Rank::calcNewRankAndScore( $newRank, $newScore);
$data = array( $data = array(
"battle_uniid" => getReqVal('battle_uuid', 0), "battle_uniid" => getReqVal('battle_uuid', 0),
"account_id" => myself()->_getAccountId(), "account_id" => myself()->_getAccountId(),
@ -205,9 +206,9 @@ class BattleDataService extends BaseService {
"weapon2" => getReqVal('weapon_uuid2', 0), "weapon2" => getReqVal('weapon_uuid2', 0),
"damage" => getReqVal('damage_out', 0), "damage" => getReqVal('damage_out', 0),
"battle_end_time" => myself()->_getNowTime(), "battle_end_time" => myself()->_getNowTime(),
"current_level_class" => $user['rank'], "current_level_class" => $newRank,
"current_level_class_score" => $user['score'], "current_level_class_score" => $newScore,
"level_class_score_chg" => $user['score']-$this->oldScore, // 排位分改变 "level_class_score_chg" => $newScore-$user['score'], // 排位分改变
"pve_rank_score" => getReqVal('pve_rank_score', 0), "pve_rank_score" => getReqVal('pve_rank_score', 0),
"pve_kill_boss" => getReqVal('pve_kill_boss', 0), "pve_kill_boss" => getReqVal('pve_kill_boss', 0),
"pve_instance_id" => getReqVal('pve_instance_id', 0), "pve_instance_id" => getReqVal('pve_instance_id', 0),
@ -457,7 +458,6 @@ class BattleDataService extends BaseService {
private function updateScore() private function updateScore()
{ {
$userInfo = myself()->_getOrmUserInfo(); $userInfo = myself()->_getOrmUserInfo();
$this->oldScore = $userInfo['score'];
$newRank = $userInfo['rank']; $newRank = $userInfo['rank'];
$newScore = FormulaService::calcBattleAfterRankScore($userInfo,$_REQUEST); //赛后排位积分 $newScore = FormulaService::calcBattleAfterRankScore($userInfo,$_REQUEST); //赛后排位积分
$newElo = FormulaService::calcUserEloValue($userInfo,$_REQUEST); //赛后elo积分 $newElo = FormulaService::calcUserEloValue($userInfo,$_REQUEST); //赛后elo积分