1
This commit is contained in:
parent
a53be7974b
commit
8a528dfce7
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once('phpcommon/tglog.php');
|
||||
require_once('models/Hero.php');
|
||||
require_once('models/HeroSkin.php');
|
||||
require_once('models/Gun.php');
|
||||
@ -35,7 +35,7 @@ use models\User;
|
||||
use models\Parachute;
|
||||
use models\ChipPage;
|
||||
use models\Battle;
|
||||
|
||||
use phpcommon\TGLog;
|
||||
|
||||
class BattleController extends BaseAuthedController {
|
||||
|
||||
@ -241,6 +241,7 @@ class BattleController extends BaseAuthedController {
|
||||
$roomBattleDataService->teamData = $teamData;
|
||||
$roomBattleDataService->calTotalBattleScore($totalScore,$totalNum);
|
||||
}
|
||||
TGLog::writeToLog("game_2006_api","battle_score",$roomBattleDataService->logData);
|
||||
$roomBattleDataService->scoreAvg = $totalScore / $totalNum;
|
||||
foreach ($input["team_list"] as $teamData){
|
||||
$battle_uuid = getXVal($teamData,'battle_uuid', 0);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace services;
|
||||
require_once('phpcommon/tglog.php');
|
||||
|
||||
require_once('models/BattleSettlement.php');
|
||||
require_once('models/Hero.php');
|
||||
require_once('models/HashRate.php');
|
||||
@ -17,7 +17,6 @@ use phpcommon\SqlHelper;
|
||||
use models\BattleSettlement;
|
||||
use models\Hero;
|
||||
use models\HashRate;
|
||||
use phpcommon\TGLog;
|
||||
|
||||
class RoomBattleDataService extends BaseService {
|
||||
const ROOM_MODE_PVP = 0;
|
||||
@ -36,12 +35,12 @@ class RoomBattleDataService extends BaseService {
|
||||
public $maxLevel= 0;
|
||||
public $maxAlive= 0;
|
||||
public $scoreAvg= 0;
|
||||
public $logData = array();
|
||||
|
||||
public function calTotalBattleScore(&$totalScore,&$totalNum){
|
||||
$logData = array();
|
||||
foreach ($this->teamData['members'] as $member){
|
||||
$battleScore = $this->_calBattleScore($member);
|
||||
array_push($logData,array(
|
||||
array_push($this->logData,array(
|
||||
'account_id' => getXVal($member, 'account_id', 0),
|
||||
'kills' => getXVal($member, 'kills', 0),
|
||||
'damage' => getXVal($member, 'damage_out', 0),
|
||||
@ -53,7 +52,7 @@ class RoomBattleDataService extends BaseService {
|
||||
$totalNum += 1;
|
||||
}
|
||||
}
|
||||
TGLog::writeToLog("game_2006_api","battle_score",$logData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user