This commit is contained in:
hujiabin 2024-09-18 16:41:00 +08:00
parent 13560f9dcf
commit 3ddb202c62
16 changed files with 413 additions and 102 deletions

View File

@ -14,7 +14,7 @@ class BattleHistory(object):
'params': [
_common.ReqHead(),
['target_id', '', ' 用户 account'],
['room_mode', '', ' 0:pvp 2:moba'],
['type', '', ' 1:pvp 2:moba 3:巡回模式'],
],
'response': [
_common.RspHead(),
@ -68,6 +68,8 @@ class BattleSettlementInfo(object):
['new_rank', 0, '新段位'],
['old_score', 0, '老段位积分'],
['new_score', 0, '新段位积分'],
['old_circuit_score', 0, '巡回赛老积分'],
['new_circuit_score', 0, '巡回赛新积分'],
['pvp_kill', 0, 'pvp击杀敌人数'],
['pvp_damage', 0, 'pvp伤害总量'],
['pvp_assist', 0, 'pvp助攻'],

35
doc/Circuit.py Normal file
View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import _common
class Circuit(object):
def __init__(self):
self.apis = [
{
'name': 'getCurrentStage',
'desc': '巡回赛当前阶段',
'group': 'Circuit',
'url': 'webapp/index.php?c=Circuit&a=getCurrentStage',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['!info', [stageInfo()], '巡回赛当前阶段信息'],
]
}
]
class stageInfo(object):
def __init__(self):
self.fields = [
['start_time', 0, '开始时间'],
['end_time', 0, '结束时间'],
['cec_pool', 0, '当前阶段奖池'],
]

View File

@ -81,6 +81,13 @@ class Other(object):
_common.RspHead(),
['!mode_list', [
['id',0,'mapMode配置id'],
['stage_state',0,'阶段开始状态 0:未开 1:已开,id=7(巡回模式)才有'],
['next_star_time',0,'下个阶段开始时间,id=7(巡回模式)才有'],
['state',0,'开启状态 0:未开 1:已开,特殊模式才有(见mapMode配置表)'],
['daily_open_time',0,'每天开始时间1,特殊模式才有(见mapMode配置表)'],
['daily_end_time',0,'每天结束时间1,特殊模式才有(见mapMode配置表)'],
['daily_open_time_2',0,'每天开始时间2,特殊模式才有(见mapMode配置表)'],
['daily_end_time_2',0,'每天结束时间2,特殊模式才有(见mapMode配置表)'],
], '地图模式列表'],
]
},

View File

@ -2037,3 +2037,23 @@ CREATE TABLE `t_contribution_history` (
KEY `idx_account_id` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_circuit_battle`
--
DROP TABLE IF EXISTS `t_circuit_battle`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_circuit_battle` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`season` int(11) NOT NULL DEFAULT '0' COMMENT '赛季',
`cumulative_score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `idx_account_season` (`account_id`, `season`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -0,0 +1,16 @@
begin;
CREATE TABLE `t_circuit_battle` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`season` int(11) NOT NULL DEFAULT '0' COMMENT '赛季',
`cumulative_score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `idx_account_season` (`account_id`, `season`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
insert into version (version) values(2024091501);
commit;

View File

@ -10,11 +10,12 @@ class BattleHistoryController extends BaseAuthedController {
public function getBattleList(){
$accountId = getReqVal('target_id', 0);
$room_mode = getReqVal('room_mode', 0);
// $room_mode = getReqVal('room_mode', 0);
$type = getReqVal('type', 0);
if (!$accountId){
$accountId = myself()->_getAccountId();
}
$singleList = BattleSettlement::getSingleList($accountId,$room_mode);
$singleList = BattleSettlement::getSingleList($accountId,$type);
$historyList = BattleHistory::orderBy($singleList,'desc');
$data = array();
foreach ($historyList as $k=>$history){

View File

@ -0,0 +1,30 @@
<?php
require_once('mt/CircuitTime.php');
require_once('models/Circuit.php');
use models\Circuit;
class CircuitController extends BaseAuthedController {
public function getCurrentStage(){
$circuitStageMeta = mt\CircuitTime::getCurrentStage();
if (!$circuitStageMeta){
$this->_rspErr(1, 'current stage Have not yet started');
return ;
}
$info = array(
'start_time' => strtotime($circuitStageMeta['start_time']),
'end_time' => strtotime($circuitStageMeta['end_time']),
'cec_pool' => $circuitStageMeta['cec_pool']
);
$this->_rspData(array('info' => $info));
}
public function getCircuitRanking(){
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
if (!$currentCircuitMeta){
$this->_rspErr(1, 'current stage Have not yet started');
return ;
}
}
}

View File

@ -9,6 +9,7 @@ require_once('mt/ActivityRewards.php');
require_once('mt/MapMode.php');
require_once('mt/ServerTaskTime.php');
require_once('mt/AchievementsCycle.php');
require_once('mt/CircuitTime.php');
@ -332,18 +333,30 @@ class OtherController extends BaseAuthedController {
// $taskStatus = GlobalData::getServerTaskStatus();
// $taskMeta = mt\ServerTaskTime::getCurrentTime();
$rankSeasonMeta = mt\RankSeason::getCurrentSeason();
mt\MapMode::traverseMeta(function($modeMeta) use(&$modeList, $rankSeasonMeta){
$circuitTimeMeta = mt\CircuitTime::getCurrentCircuit();
mt\MapMode::traverseMeta(function($modeMeta) use(&$modeList, $rankSeasonMeta,$circuitTimeMeta){
if ($modeMeta['is_open']) {
if ($modeMeta['limit_time'] == 1 && !$rankSeasonMeta) {
return true;
}
// if ($modeMeta['limit_time'] == 2 ){
// return true;
// }
if ($modeMeta['limit_time'] == 3 && !$circuitTimeMeta){
return true;
}
$temp = array(
'id' => $modeMeta['id']
);
if ($modeMeta['limit_time'] == 3){
$circuitStageMeta = mt\CircuitTime::getCurrentStage();
if($circuitStageMeta){
$temp['stage_state'] = 1;
}else{
$temp['stage_state'] = 0;
$nextStageMeta = mt\CircuitTime::getNextStage($circuitTimeMeta['circuit_season']);
$temp['next_star_time'] = strtotime($nextStageMeta['start_time']);
}
}
if ($modeMeta['daily_open_time']){
$dailyOpenTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ".$modeMeta['daily_open_time']));
$dailyEndTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ".$modeMeta['daily_end_time']));
@ -368,12 +381,16 @@ class OtherController extends BaseAuthedController {
}
}
$isOpen = mt\MapMode::isOpen($modeMeta);
if ($isOpen) {
array_push(
$modeList,
$temp
);
if ($modeMeta['mapMode'] == \mt\MapMode::CIRCUIT_MODE){
array_unshift($modeList,$temp);
}else{
array_push($modeList, $temp);
}
}
}
return true;

View File

@ -15,6 +15,10 @@ class BattleSettlement extends BaseModel
const MATCH_MODE_PVP = 0;
const MATCH_MODE_RANK = 1;
const PVP_MODE_TYPE = 1;
const MOBA_MODE_TYPE = 2;
const CIRCUIT_MODE_TYPE = 3;
public static function add($battleUuid, $data)
{
SqlHelper::upsert
@ -84,7 +88,7 @@ class BattleSettlement extends BaseModel
);
}
public static function getSingleList($accountId,$roomMode)
public static function getSingleList($accountId,$type)
{
$rows = SqlHelper::ormSelect
(myself()->_getSelfMysql(),
@ -95,23 +99,30 @@ class BattleSettlement extends BaseModel
);
$pvpBattleList = array();
$mobaBattleList = array();
$circuitBattleList = array();
foreach ($rows as $row) {
$data = emptyReplace(json_decode($row['data'], true), array());
if ($data['room_mode'] == self::ROOM_MODE_PVP ) {
if ($data['battle_history_type'] == self::PVP_MODE_TYPE ) {
array_push($pvpBattleList, self::singleDto($row));
} else if ($data['room_mode'] == self::ROOM_MODE_MOBA) {
} else if ($data['battle_history_type'] == self::MOBA_MODE_TYPE) {
array_push($mobaBattleList, self::singleDto($row));
}else if($data['battle_history_type'] == self::CIRCUIT_MODE_TYPE){
array_push($circuitBattleList, self::singleDto($row));
}
}
switch ($roomMode) {
case self::ROOM_MODE_PVP :
switch ($type) {
case self::PVP_MODE_TYPE :
{
return $pvpBattleList;
}
case self::ROOM_MODE_MOBA :
case self::MOBA_MODE_TYPE :
{
return $mobaBattleList;
}
case self::CIRCUIT_MODE_TYPE :
{
return $circuitBattleList;
}
default : {
return array();
}

44
webapp/models/Circuit.php Normal file
View File

@ -0,0 +1,44 @@
<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class Circuit extends BaseModel
{
public static function updateScore($season,$score){
SqlHelper::upsert(
myself()->_getSelfMysql(),
't_circuit_battle',
array(
'account_id' => myself()->_getAccountId(),
'season' => $season
),
array(
'cumulative_score' => $score,
'modifytime' => myself()->_getNowTime()
),
array(
'account_id' => myself()->_getAccountId(),
'season' => $season,
'cumulative_score' => $score,
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
}
public static function getMyScore($season){
$row = SqlHelper::ormSelectOne(
myself()->_getMysql(''),
't_circuit_battle',
array(
'account_id' => myself()->_getAccountId(),
'season' => $season
)
);
return $row ? $row['cumulative_score'] : 0;
}
}

View File

@ -71,6 +71,17 @@ class User extends BaseModel {
return $rows ? $rows : null;
}
public static function getVipLv($address){
$row = SqlHelper::ormSelectOne(
myself()->_getMarketMysql(''),
't_staking_cec',
array(
'account_address' => $address
)
);
return $row ? $row['vip_lv'] : 0;
}
public static function show($row)
{
$heroDb = Hero::findByAccountId($row['account_id'],$row['hero_id']);
@ -130,6 +141,7 @@ class User extends BaseModel {
'honor_info' => $honorInfo,
'account_lucky' => $lucky,
'chest_rate' => $rate,
'vip_lv' => self::getVipLv($row['address']),
);
}
@ -195,6 +207,7 @@ class User extends BaseModel {
'last_login_time' => $row['last_login_time'],
'account_lucky' => $lucky,
'chest_rate' => $rate,
'vip_lv' => self::getVipLv($row['address']),
);
}

73
webapp/mt/CircuitTime.php Normal file
View File

@ -0,0 +1,73 @@
<?php
namespace mt;
use phpcommon;
class CircuitTime {
const WHOLE_SEASON__TYPE = 1;
const STAGE_SEASON_TYPE = 2;
public static function getCurrentCircuit(){
foreach (self::getCircuitAll(self::WHOLE_SEASON__TYPE) as $meta){
if (myself()->_getNowTime() >= strtotime($meta['start_time']) &&
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
return $meta;
}
}
return null;
}
public static function getCurrentStage(){
foreach (self::getCircuitAll(self::STAGE_SEASON_TYPE) as $meta){
if (myself()->_getNowTime() >= strtotime($meta['start_time']) &&
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
return $meta;
}
}
return null;
}
public static function getNextStage($season){
$next = array();
foreach (self::getListBySeason($season) as $meta){
if (myself()->_getNowTime() < strtotime($meta['start_time'])){
$next = $meta;
break;
}
}
return $next;
}
public static function getCircuitAll($type){
$metas =array();
foreach (self::getMetaList() as $meta){
if ($meta['circuit_time_type'] == $type){
array_push($metas,$meta);
}
}
return $metas;
}
private static function getListBySeason($season){
$metas =array();
foreach (self::getMetaList() as $meta){
if ($meta['circuit_season'] == $season && $meta['circuit_time_type'] == self::STAGE_SEASON_TYPE){
array_push($metas,$meta);
}
}
return $metas;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('CircuitTime@CircuitTime.php');
}
return self::$metaList;
}
protected static $metaList;
}

View File

@ -12,6 +12,7 @@ class MapMode
const BET_MODE = 301;
const RANKING_MODE = 401;
const TREASURE_BOX_MODE = 501;
const CIRCUIT_MODE = 601;
public static function find($id){
return getXVal(self::getMetaList(), $id);

44
webapp/mt/StakingVip.php Normal file
View File

@ -0,0 +1,44 @@
<?php
namespace mt;
use phpcommon;
class StakingVip {
const GAIN_GOLD = 1;
const HERO_UP = 2;
const ACCOUNT_TIMES = 3;
const GOLD_CUT_DOWN = 4;
const DIAMOND_CUT_DOWN = 5;
const ACCOUNT_LUCKY_INC = 6;
public static function find($lv)
{
foreach (self::getMetaList() as $meta){
if ($meta['rank'] == $lv){
return $meta;
}
}
return array();
}
// public static function exportRights($lv){
// $meta = self::find($lv);
// if (!$meta || empty($meta['rights'])){
// return array();
// }
// $rights = explode('|',$meta['rights']);
// }
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('stakingVip@stakingVip.php');
}
return self::$metaList;
}
protected static $metaList;
}

View File

@ -6,17 +6,20 @@ require_once('models/Hero.php');
require_once('models/HashRate.php');
require_once('models/Season.php');
require_once('models/TicketConsumeRecord.php');
require_once('models/Circuit.php');
require_once('mt/MapMode.php');
require_once('mt/Rank.php');
require_once('mt/RankSeason.php');
require_once('mt/EconomyAttribute.php');
require_once('mt/CircuitTime.php');
require_once('services/AwardService.php');
require_once('services/PropertyChgService.php');
require_once('services/LogService.php');
require_once('phpcommon/tglog.php');
use models\Circuit;
use models\TicketConsumeRecord;
use mt;
use services;
@ -123,6 +126,20 @@ class RoomBattleDataService extends BaseService {
$member['new_score'] = $newScore;
$member['new_elo'] = $newElo;
}
//巡回模式排位分计算
if ($this->mapMode == mt\MapMode::CIRCUIT_MODE){
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
if ($circuitMeta){
$minScore = mt\Parameter::getVal('circuit_rank_score_min',0);
$multConstant = mt\Parameter::getVal('circuit_score_mult_constant',1);
$shiftConstant = mt\Parameter::getVal('circuit_score_shift_constant',1);
$circuitScore = $battleScore * $multConstant + $shiftConstant;
$myScore = Circuit::getMyScore($circuitMeta['circuit_season']);
$finalScore = max($minScore, $myScore+$circuitScore);
Circuit::updateScore($circuitMeta['circuit_season'],$finalScore);
$member['new_circuit_score'] = $finalScore;
}
}
if ($this->mapMode == mt\MapMode::TREASURE_BOX_MODE && $member['move_distance'] <= 2000 ){
error_log("金币模式:消极战斗");
@ -141,6 +158,7 @@ class RoomBattleDataService extends BaseService {
$battleSingleData['new_rank'] = $member['new_rank'];
$battleSingleData['new_score'] = $member['new_score'];
$battleSingleData['new_elo'] = $member['new_elo'];
$battleSingleData['new_circuit_score'] = $member['new_circuit_score'];
BattleSettlement::addSingle($battleSingleDb['battle_uuid'],$battleSingleDb['room_uuid'],$battleSingleData);
}
}else{
@ -325,8 +343,10 @@ class RoomBattleDataService extends BaseService {
$paramMeta = mt\Parameter::getVal('performance_score_range',0);
$paramMetaMoba = mt\Parameter::getVal('performance_score_weight_4V4',0);
$paramMetaPvp = mt\Parameter::getVal('performance_score_weight_BR',0);
$paramMetaCircuit = mt\Parameter::getVal('performance_score_weight_circuit',0);
$weightMoba = explode("|",$paramMetaMoba);
$weightPvp = explode("|",$paramMetaPvp);
$weightCircuit = explode("|",$paramMetaCircuit);
$scoreParam = explode("|",$paramMeta);
if (count($scoreParam) < 2){
error_log('Parameter table error');
@ -388,12 +408,22 @@ class RoomBattleDataService extends BaseService {
)));
switch ($room_mode){
case self::ROOM_MODE_PVP: {
if (count($weightPvp) == 5){
$killSco *= $weightPvp[0];
$assistSco *= $weightPvp[1];
$damageSco *= $weightPvp[2];
$recoverSco *= $weightPvp[3];
$aliveSco *= $weightPvp[4];
if (getXVal($this->inputData,'map_mode', 0) == mt\MapMode::CIRCUIT_MODE){
if (count($weightCircuit) == 5){
$killSco *= $weightCircuit[0];
$assistSco *= $weightCircuit[1];
$damageSco *= $weightCircuit[2];
$recoverSco *= $weightCircuit[3];
$aliveSco *= $weightCircuit[4];
}
}else{
if (count($weightPvp) == 5){
$killSco *= $weightPvp[0];
$assistSco *= $weightPvp[1];
$damageSco *= $weightPvp[2];
$recoverSco *= $weightPvp[3];
$aliveSco *= $weightPvp[4];
}
}
$battleScore = ($killSco + $assistSco + $damageSco + $recoverSco + $aliveSco);
}

View File

@ -15,6 +15,7 @@ require_once('mt/AchievementsCycle.php');
require_once('mt/ServerTaskTime.php');
require_once('mt/MapMode.php');
require_once('mt/BattleReward.php');
require_once('mt/CircuitTime.php');
require_once('models/Season.php');
require_once('models/Battle.php');
@ -24,6 +25,7 @@ require_once('models/BattleSettlement.php');
require_once('models/RankBattle.php');
require_once('models/HashRateBattleData.php');
require_once('models/GlobalData.php');
require_once('models/Circuit.php');
require_once('services/RankActivityService.php');
require_once('services/AwardService.php');
@ -34,6 +36,7 @@ require_once('services/LootService.php');
use models\BattleSettlement;
use models\Circuit;
use models\FragmentRecord;
use models\GlobalData;
use models\HashRate;
@ -102,7 +105,7 @@ class TameBattleDataService extends BaseService {
}
myself()->_fireEvent('Battle','onSettlement',$this->battleInfo);
//记录战斗有效行为
$this->_updateBattleData();
// $this->_updateBattleData();
//记录战斗数据的排行榜
$this->recordBattleRanking();
switch ($matchMode) {
@ -513,33 +516,29 @@ class TameBattleDataService extends BaseService {
mt\Rank::calcNewRankAndScore( $newRank, $newScore);
}
}
// $data = array(
// "battle_uuid" => $battleUuid,
// "account_id" => getXVal($this->battleInfo,'account_id', 0),
// "room_mode" => getXVal($this->allInfo,'room_mode', 0),
// "pvp_mode" => $pvp_mode,
// "team_mode" => getXVal($this->allInfo,'team_mode', 0),
// "battle_rank" => getXVal($this->battleInfo,'pvp_personal_rank', 0),
// "team_rank" => getXVal($this->allInfo,'pvp_team_rank', 0),
// "team_kills" => getXVal($this->allInfo,'pvp_team_kills', 0),
// "is_win" => getXVal($this->battleInfo,'pve_boss_killed', 0),
// "kills" => getXVal($this->battleInfo,'kills', 0),
// "hero_id" => getXVal($this->battleInfo,'hero_uniid', 0),
// "weapon1" => getXVal($this->battleInfo,'weapon_uuid1', 0),
// "weapon2" => getXVal($this->battleInfo,'weapon_uuid2', 0),
// "battle_end_time" => getXVal($this->battleInfo,'game_time', 0),
// "current_level_class" => $newRank,
// "current_level_class_score" => $newScore,
// "level_class_score_chg" => $newScore - $this->userInfo['score'], // 排位分改变
// "pve_rank_score" => getXVal($this->battleInfo,'pve_score', 0),
// "pve_kill_boss" => getXVal($this->battleInfo,'pve_boss_killed', 0),
// "pve_instance_id" => getXVal($this->allInfo,'pve_instance_id', 0),
//// "pve_instance_mode" => getXVal($this->allInfo,'pve_instance_mode', 0),
// "old_elo" => $this->userInfo['elo'],
// "new_elo" => $newElo,
// 'reward' => array(),
// );
switch (getXVal($this->allInfo,'room_mode', 0)){
case self::ROOM_MODE_PVP:
{
if (getXVal($this->allInfo,'map_mode', 0) == mt\MapMode::CIRCUIT_MODE){
$battle_history_type = 3;
}else{
$battle_history_type = 1;
}
}
break;
case self::ROOM_MODE_MOBA:
{
$battle_history_type = 2;
}
break;
default:
{
$team_mode = null;
$battle_history_type = 0;
}
}
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
$data = array(
"battle_uuid" => $battleUuid,
"map_mode_id" => getXVal($this->allInfo,'map_mode_id', 0),
@ -568,6 +567,8 @@ class TameBattleDataService extends BaseService {
'new_score'=> $newScore,
'old_elo'=> $oldElo,
'new_elo'=> $newElo,
'old_circuit_score'=> $circuitScore,
'new_circuit_score'=> $circuitScore,
'pvp_kill'=> getXVal($this->battleInfo,'pvp_kill', 0),
'pvp_damage'=> getXVal($this->battleInfo,'pvp_damage', 0),
'pvp_assist'=> getXVal($this->battleInfo,'pvp_assist', 0),
@ -587,6 +588,7 @@ class TameBattleDataService extends BaseService {
'hero_lv'=> getXVal($this->battleInfo,'hero_level', 1),
'dead_times'=> getXVal($this->battleInfo,'dead_times', 0),
"game_time" => getXVal($this->battleInfo,'game_time', 0),
"battle_history_type" => $battle_history_type,
'reward' => array(),
);
BattleSettlement::addSingle($battleUuid,$roomUuid,$data);
@ -599,20 +601,26 @@ class TameBattleDataService extends BaseService {
switch ($room_mode){
case self::ROOM_MODE_PVP:
{
$team_mode = getXVal($this->allInfo,'pvp_settelement_type', 0);
if (getXVal($this->allInfo,'map_mode', 0) == mt\MapMode::CIRCUIT_MODE){
$battle_history_type = 3;
}else{
$battle_history_type = 1;
}
}
break;
case self::ROOM_MODE_PVE:
case self::ROOM_MODE_MOBA:
{
$team_mode = getXVal($this->allInfo,'pve_settelement_type', 0);
$battle_history_type = 2;
}
break;
default:
{
$team_mode = null;
$battle_history_type = 0;
}
break;
}
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
$data = array(
'version'=> getXVal($this->allInfo,'version', 0),
'team_id'=> getXVal($this->allInfo,'team_id', 0),
@ -620,7 +628,8 @@ class TameBattleDataService extends BaseService {
'room_mode'=> getXVal($this->allInfo,'room_mode', 0),
'map_mode'=> getXVal($this->allInfo,'map_mode', 0),
'map_mode_id'=> getXVal($this->allInfo,'map_mode_id', 0),
'team_mode'=> $team_mode,
'battle_history_type'=> $battle_history_type,
'team_mode'=> getXVal($this->allInfo,'pvp_settelement_type', 0),
'game_over'=>1,
'victory'=> getXVal($this->allInfo,'victory', 0),
'watchable'=> 1,
@ -700,6 +709,8 @@ class TameBattleDataService extends BaseService {
'new_score'=> $newScore,
'old_elo'=> $oldElo,
'new_elo'=> $newElo,
'old_circuit_score'=> $circuitScore,
'new_circuit_score'=> $circuitScore,
'pvp_kill'=> getXVal($info,'pvp_kill', 0),
'pvp_damage'=> getXVal($info,'pvp_damage', 0),
'pvp_assist'=> getXVal($info,'pvp_assist', 0),
@ -1178,44 +1189,6 @@ class TameBattleDataService extends BaseService {
);
}
//服务器大事件任务统计
// $server_task_state = GlobalData::getServerTaskStatus();
// $currentServerTask = mt\ServerTaskTime::getCurrentTime();
// if (!isset($serverTaskData['data'])) {
// $serverTaskData['data'] = array(
// 'createtime' => myself()->_getNowTime(),
// 'modifytime' => myself()->_getNowTime()
// );
// }
// if ($currentServerTask && myself()->_getDaySeconds($serverTaskData['data']['modifytime']) <
// myself()->_getDaySeconds(strtotime($currentServerTask['obtain_start_time']))) {
// $serverTaskData['data'] = array(
// 'createtime' => $serverTaskData['data']['createtime'],
// 'modifytime' => myself()->_getNowTime()
// );
// }
// if ($currentHashRate && strtotime($currentHashRate['obtain_end_time']) > myself()->_getNowTime()){
// switch (getXVal($this->allInfo,'room_mode', 0)){
// case self::MATCH_MODE_PVP :{
// $this->applyEx($hisBattleData['data']['pvpData']);
// }
// break;
// case self::ROOM_MODE_MOBA :{
// $this->applyEx($hisBattleData['data']['mobaData']);
// }
// break;
// default:{
//
// }
// break;
// }
// $hisBattleData['data']['modifytime'] = myself()->_getNowTime();
// }
switch (getXVal($this->allInfo,'room_mode', 0)){
case self::MATCH_MODE_PVP :{
if ($currentHashRate &&
@ -1241,15 +1214,9 @@ class TameBattleDataService extends BaseService {
break;
default:{}
}
// if (! $server_task_state && $currentServerTask &&
// if ( $currentServerTask &&
// myself()->_getNowTime() > strtotime($currentServerTask['obtain_start_time']) &&
// myself()->_getNowTime() < strtotime($currentServerTask['obtain_end_time'])) {
// $this->applyEx($serverTaskData['data']);
// $serverTaskData['data']['modifytime'] = myself()->_getNowTime();
// }
HashRateBattleData::add(json_encode($hisBattleData));
// GlobalData::addServerTaskData($serverTaskData);
}
private function applyEx(&$battleData)