Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
9ae1f23342
@ -1077,7 +1077,7 @@ CREATE TABLE `t_rank_battle` (
|
|||||||
`channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
|
`channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
|
||||||
`mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2:pvp',
|
`mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2:pvp',
|
||||||
`class` int(11) NOT NULL DEFAULT '0' COMMENT '1:总榜 2:日榜 3:周榜',
|
`class` int(11) NOT NULL DEFAULT '0' COMMENT '1:总榜 2:日榜 3:周榜',
|
||||||
`type` int(11) NOT NULL DEFAULT '0' COMMENT 'type 1:场次榜 2:吃鸡榜 3:mvp榜 4:前三名榜 5:击杀榜',
|
`type` int(11) NOT NULL DEFAULT '0' COMMENT 'type 1:场次榜 2:吃鸡榜 3:mvp榜 4:前三名榜 5:击杀榜 6:伤害 7:助攻 8:治疗量 9:存活时间 10:救援数',
|
||||||
`value` bigint NOT NULL DEFAULT '0' COMMENT 'value',
|
`value` bigint NOT NULL DEFAULT '0' COMMENT 'value',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
|
@ -50,7 +50,7 @@ class BagController extends BaseAuthedController {
|
|||||||
|
|
||||||
public function createGuildConsume()
|
public function createGuildConsume()
|
||||||
{
|
{
|
||||||
$consume = explode("|",mt\Parameter::getVal('create_club_cost'));
|
$consume = explode("|",mt\Parameter::getVal('create_club_cost', ''));
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
array(
|
array(
|
||||||
'item_id' => $consume[0],
|
'item_id' => $consume[0],
|
||||||
|
@ -8,6 +8,7 @@ class BaseController {
|
|||||||
private $marketDbConn = null;
|
private $marketDbConn = null;
|
||||||
private $relationDbConn = null;
|
private $relationDbConn = null;
|
||||||
private $timeOffset = 0;
|
private $timeOffset = 0;
|
||||||
|
private $serviceHash = array();
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
@ -235,4 +236,15 @@ class BaseController {
|
|||||||
return $channel == "0000";
|
return $channel == "0000";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function callService($serviceName, $funcName)
|
||||||
|
{
|
||||||
|
if (!array_key_exists($serviceName, $this->serviceHash)) {
|
||||||
|
require_once('services/' . $serviceName . '.php');
|
||||||
|
$this->serviceHash[$serviceName] = $this->_getNowTime();
|
||||||
|
}
|
||||||
|
$method = new ReflectionMethod($serviceName . 'Service', $funcName);
|
||||||
|
$ret = $method->invoke(null);
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,8 @@ class BattleController extends BaseAuthedController {
|
|||||||
'node_id' => $nodeId,
|
'node_id' => $nodeId,
|
||||||
'room_uuid' => $roomUuid,
|
'room_uuid' => $roomUuid,
|
||||||
'start_time' => $startTime,
|
'start_time' => $startTime,
|
||||||
'team_list' => array()
|
'team_list' => array(),
|
||||||
|
'ob_list' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
$currSeason = mt\RankSeason::getCurrentSeason();
|
$currSeason = mt\RankSeason::getCurrentSeason();
|
||||||
@ -539,6 +540,61 @@ class BattleController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
array_push($data['team_list'], $teamInfo);
|
array_push($data['team_list'], $teamInfo);
|
||||||
}
|
}
|
||||||
|
foreach ($customData['ob_list'] as $member) {
|
||||||
|
$accountId = $member['account_id'];
|
||||||
|
$switchOk = $this->switchOnlineAccount($accountId);
|
||||||
|
if (!$switchOk) {
|
||||||
|
myself()->_rspErr(1, 'data error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$info = $this->genInitBattleData();
|
||||||
|
$userDb = User::find($accountId);
|
||||||
|
if ($userDb) {
|
||||||
|
$userPresetInfo = User::toPreset($userDb);
|
||||||
|
$info['elo'] = $userDb['elo'];
|
||||||
|
$info['rank'] = $userDb['rank'];
|
||||||
|
$info['name'] = $userPresetInfo['name'];
|
||||||
|
$info['level'] = $userPresetInfo['level'];
|
||||||
|
$info['parachute'] = $userPresetInfo['parachute'];
|
||||||
|
$info['hero_uniid'] = $userPresetInfo['hero_uniId'];
|
||||||
|
$info['hero_id'] = $userPresetInfo['hero_id'];
|
||||||
|
$info['hero_skin'] = $userPresetInfo['hero_skin'];
|
||||||
|
$info['skill_id'] = $userPresetInfo['presetInfo']['skill_id'];
|
||||||
|
$info['weapon_uuid1'] = $userPresetInfo['presetInfo']['weapon_uid1'];
|
||||||
|
$info['weapon_uuid2'] = $userPresetInfo['presetInfo']['weapon_uid2'];
|
||||||
|
//$chipPageDb = ChipPage::find($userPresetInfo['hero_uniId']);
|
||||||
|
//$info['chip_page'] = ChipPage::toDtoBattle($chipPageDb);
|
||||||
|
$info['honor_info'] = $userPresetInfo['honor_info'];
|
||||||
|
$battleDb = Battle::find($accountId);
|
||||||
|
if ($battleDb){
|
||||||
|
$battleData = json_decode($battleDb['battle_data'], true);
|
||||||
|
$seasonBattleData = isset($battleData) ? getXVal($battleData, 'data', array()) : array();
|
||||||
|
$info['battle_times'] = getXVal($seasonBattleData, 'total_battle_times', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$heroDb = Hero::findByAccountId($accountId,$info['hero_uniid']);
|
||||||
|
if ($heroDb) {
|
||||||
|
$info['is_valid_battle'] = 1;
|
||||||
|
$info['hero_dto'] = Hero::toDto($heroDb);
|
||||||
|
} else {
|
||||||
|
$info['errcode'] = 51;
|
||||||
|
$info['errmsg'] = 'paramater error';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
$itemDb = Bag::findEx($accountId, V_ITEM_REVIVE_COIN);
|
||||||
|
$info['revive_coin'] = $itemDb && $itemDb['item_num'] > 0 ? $itemDb['item_num'] : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
$info['match_mode'] = 0;
|
||||||
|
if ($currSeason){
|
||||||
|
$info['match_mode'] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_push($data['ob_list'], $info);
|
||||||
|
}
|
||||||
error_log(json_encode($data));
|
error_log(json_encode($data));
|
||||||
myself()->_rspData($data);
|
myself()->_rspData($data);
|
||||||
}
|
}
|
||||||
@ -921,7 +977,7 @@ class BattleController extends BaseAuthedController {
|
|||||||
// $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc');
|
// $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc');
|
||||||
$data = array();
|
$data = array();
|
||||||
foreach ($historyList as $k=>$history){
|
foreach ($historyList as $k=>$history){
|
||||||
if ($k < 20){
|
if ($k < 40){
|
||||||
array_push($data,BattleHistory::toDto($history));
|
array_push($data,BattleHistory::toDto($history));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,11 @@ class RankBattle extends BaseModel
|
|||||||
const MVP_TIMES = 3;
|
const MVP_TIMES = 3;
|
||||||
const TOP_THREE_TIMES = 4;
|
const TOP_THREE_TIMES = 4;
|
||||||
const KILL_TIMES = 5;
|
const KILL_TIMES = 5;
|
||||||
|
const DAMAGES_OUT = 6;
|
||||||
|
const ASSIST_TIMES = 7;
|
||||||
|
const RECOVER_HP = 8;
|
||||||
|
const SURVIVAL_TIME = 9;
|
||||||
|
const RESCUE_TIMES = 10;
|
||||||
|
|
||||||
const OVERALL_CHARTS = 1;
|
const OVERALL_CHARTS = 1;
|
||||||
const DAILY_CHARTS = 2;
|
const DAILY_CHARTS = 2;
|
||||||
@ -114,7 +119,6 @@ class RankBattle extends BaseModel
|
|||||||
if (!self::inspectType($type)){
|
if (!self::inspectType($type)){
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = array();
|
$row = array();
|
||||||
switch ($class) {
|
switch ($class) {
|
||||||
case self::OVERALL_CHARTS : {
|
case self::OVERALL_CHARTS : {
|
||||||
@ -129,7 +133,7 @@ class RankBattle extends BaseModel
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case self::DAILY_CHARTS :{
|
case self::DAILY_CHARTS :{
|
||||||
$row = SqlHelper::ormSelectOne
|
$row = SqlHelper::ormSelectOne
|
||||||
(myself()->_getSelfMysql(),
|
(myself()->_getSelfMysql(),
|
||||||
@ -143,7 +147,7 @@ class RankBattle extends BaseModel
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case self::WEEKLY_CHARTS:{
|
case self::WEEKLY_CHARTS:{
|
||||||
$row = SqlHelper::ormSelectOne
|
$row = SqlHelper::ormSelectOne
|
||||||
(myself()->_getSelfMysql(),
|
(myself()->_getSelfMysql(),
|
||||||
@ -159,6 +163,7 @@ class RankBattle extends BaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $row ;
|
return $row ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function upsert($account,$mode,$type,$val){
|
public static function upsert($account,$mode,$type,$val){
|
||||||
|
11
webapp/services/MsgQueueService.php
Normal file
11
webapp/services/MsgQueueService.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace services;
|
||||||
|
|
||||||
|
class MsgQueueService extends BaseService {
|
||||||
|
|
||||||
|
public static function postMsg() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -192,6 +192,31 @@ class TameBattleDataService extends BaseService {
|
|||||||
if (getXVal($this->battleInfo,'pvp_kill', 0) > 0){
|
if (getXVal($this->battleInfo,'pvp_kill', 0) > 0){
|
||||||
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'pvp_kill', 0));
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'pvp_kill', 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//伤害
|
||||||
|
if (getXVal($this->battleInfo,'pvp_damage', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::DAMAGES_OUT,getXVal($this->battleInfo,'pvp_damage', 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//助攻
|
||||||
|
if (getXVal($this->battleInfo,'pvp_assist', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::ASSIST_TIMES,getXVal($this->battleInfo,'pvp_assist', 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//治疗
|
||||||
|
if (getXVal($this->battleInfo,'pvp_recover', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::RECOVER_HP,getXVal($this->battleInfo,'pvp_recover', 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//存活时间
|
||||||
|
if (getXVal($this->battleInfo,'pvp_survia_time', 0)/1000 >= 1 ){
|
||||||
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::SURVIVAL_TIME,round(getXVal($this->battleInfo,'pvp_survia_time', 0)/1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
//救援数
|
||||||
|
if (getXVal($this->battleInfo,'pvp_rescue', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::RESCUE_TIMES,getXVal($this->battleInfo,'pvp_rescue', 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case self::ROOM_MODE_MOBA : {
|
case self::ROOM_MODE_MOBA : {
|
||||||
@ -207,6 +232,18 @@ class TameBattleDataService extends BaseService {
|
|||||||
if (getXVal($this->battleInfo,'kills', 0) > 0){
|
if (getXVal($this->battleInfo,'kills', 0) > 0){
|
||||||
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'kills', 0));
|
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'kills', 0));
|
||||||
}
|
}
|
||||||
|
//伤害
|
||||||
|
if (getXVal($this->battleInfo,'damage_out', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::DAMAGES_OUT,getXVal($this->battleInfo,'damage_out', 0));
|
||||||
|
}
|
||||||
|
//助攻
|
||||||
|
if (getXVal($this->battleInfo,'assist', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::ASSIST_TIMES,getXVal($this->battleInfo,'assist', 0));
|
||||||
|
}
|
||||||
|
//治疗
|
||||||
|
if (getXVal($this->battleInfo,'recover_hp', 0) > 0){
|
||||||
|
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::RECOVER_HP,getXVal($this->battleInfo,'recover_hp', 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,6 +615,8 @@ class TameBattleDataService extends BaseService {
|
|||||||
'pve_wave'=> getXVal($this->allInfo,'pve_wave', 0),
|
'pve_wave'=> getXVal($this->allInfo,'pve_wave', 0),
|
||||||
'pve_max_wave'=> getXVal($this->allInfo,'pve_max_wave', 0),
|
'pve_max_wave'=> getXVal($this->allInfo,'pve_max_wave', 0),
|
||||||
'pve_instance_id'=> getXVal($this->allInfo,'pve_instance_id', 0),
|
'pve_instance_id'=> getXVal($this->allInfo,'pve_instance_id', 0),
|
||||||
|
'moba_my_team_kills'=> getXVal($this->allInfo,'moba_my_team_kills', 0),
|
||||||
|
'moba_enemy_team_kills'=> getXVal($this->allInfo,'moba_enemy_team_kills', 0),
|
||||||
);
|
);
|
||||||
|
|
||||||
$data['members'] = array();
|
$data['members'] = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user