From 4608116a7038cb0b857bf5435b3d4cfe8881a318 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 1 Feb 2024 17:47:34 +0800 Subject: [PATCH 1/7] 1 --- webapp/models/RankBattle.php | 58 ++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/webapp/models/RankBattle.php b/webapp/models/RankBattle.php index dd0d683f..41224886 100644 --- a/webapp/models/RankBattle.php +++ b/webapp/models/RankBattle.php @@ -91,7 +91,7 @@ class RankBattle extends BaseModel $sql = "select {$field} from t_rank_battle where mode=:mode and class =:class and type=:type and writetime=:writetime order by value desc,modifytime asc limit {$limit} "; $whereKv = array( "mode" => $mode, - "class" => self::DAILY_CHARTS, + "class" => self::WEEKLY_CHARTS, "type" => $type, "writetime" => myself()->_getMondaySeconds(), ); @@ -114,17 +114,51 @@ class RankBattle extends BaseModel if (!self::inspectType($type)){ return array(); } - $row = SqlHelper::ormSelectOne - (myself()->_getSelfMysql(), - 't_rank_battle', - array( - 'account_id' => myself()->_getAccountId(), - 'type' => $type, - 'mode' => $mode, - 'class' => $class, - ) - ); - return $row ? $row : null; + $row = array(); + switch ($class) { + case self::OVERALL_CHARTS : { + $row = SqlHelper::ormSelectOne + (myself()->_getSelfMysql(), + 't_rank_battle', + array( + 'account_id' => myself()->_getAccountId(), + 'type' => $type, + 'mode' => $mode, + 'class' => $class, + ) + ); + } + break; + case self::DAILY_CHARTS :{ + $row = SqlHelper::ormSelectOne + (myself()->_getSelfMysql(), + 't_rank_battle', + array( + 'account_id' => myself()->_getAccountId(), + 'type' => $type, + 'mode' => $mode, + 'class' => $class, + "writetime" => myself()->_getNowDaySeconds(), + ) + ); + } + break; + case self::WEEKLY_CHARTS:{ + $row = SqlHelper::ormSelectOne + (myself()->_getSelfMysql(), + 't_rank_battle', + array( + 'account_id' => myself()->_getAccountId(), + 'type' => $type, + 'mode' => $mode, + 'class' => $class, + "writetime" => myself()->_getMondaySeconds(), + ) + ); + } + } + return $row ; + } public static function upsert($account,$mode,$type,$val){ From 4ee44338896a687d6e6dbaae08010f41732dac31 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 4 Feb 2024 17:17:26 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=82=E6=88=98?= =?UTF-8?q?=E9=98=9F=E4=BC=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/controller/BattleController.class.php | 58 +++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 55f328fc..0573b813 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -363,7 +363,8 @@ class BattleController extends BaseAuthedController { 'node_id' => $nodeId, 'room_uuid' => $roomUuid, 'start_time' => $startTime, - 'team_list' => array() + 'team_list' => array(), + 'ob_list' => array() ); $currSeason = mt\RankSeason::getCurrentSeason(); @@ -429,6 +430,61 @@ class BattleController extends BaseAuthedController { } 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)); myself()->_rspData($data); } From be5a142dc2ec1ba7f17876d7f234ed0eb7c63373 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 4 Feb 2024 17:20:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0moba=E5=88=86=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/services/TameBattleDataService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index 40afd27e..90d6afb9 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -517,6 +517,8 @@ class TameBattleDataService extends BaseService { 'pve_wave'=> getXVal($this->allInfo,'pve_wave', 0), 'pve_max_wave'=> getXVal($this->allInfo,'pve_max_wave', 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(); From 07eacbc353e3c9881716672edad8ea510c88edc2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Feb 2024 15:45:24 +0800 Subject: [PATCH 4/7] 1 --- webapp/controller/BattleController.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 0573b813..2ebb7784 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -275,8 +275,8 @@ class BattleController extends BaseAuthedController { $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['presetInfo']['chip_page']); - $info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); + //$chipPageDb = ChipPage::find($userPresetInfo['presetInfo']['chip_page']); + //$info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); $info['honor_info'] = $userPresetInfo['honor_info']; $battleDb = Battle::find($account_id); if ($battleDb){ @@ -395,8 +395,8 @@ class BattleController extends BaseAuthedController { $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['presetInfo']['chip_page']); - $info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); + //$chipPageDb = ChipPage::find($userPresetInfo['presetInfo']['chip_page']); + //$info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); $info['honor_info'] = $userPresetInfo['honor_info']; $battleDb = Battle::find($accountId); if ($battleDb){ @@ -452,8 +452,8 @@ class BattleController extends BaseAuthedController { $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); + //$chipPageDb = ChipPage::find($userPresetInfo['hero_uniId']); + //$info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); $info['honor_info'] = $userPresetInfo['honor_info']; $battleDb = Battle::find($accountId); if ($battleDb){ @@ -553,8 +553,8 @@ class BattleController extends BaseAuthedController { $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['presetInfo']['chip_page']); - $info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); + //$chipPageDb = ChipPage::find($userPresetInfo['presetInfo']['chip_page']); + //$info['chip_page'] = ChipPage::toDtoBattle($chipPageDb); $info['honor_info'] = $userPresetInfo['honor_info']; $battleDb = Battle::find($accountId); if ($battleDb){ From b8d4ea7e1b2dabf3ec4f17dd2075e9093cc350e9 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 26 Feb 2024 16:57:01 +0800 Subject: [PATCH 5/7] 1 --- sql/gamedb.sql | 2 +- webapp/controller/BattleController.class.php | 2 +- webapp/models/RankBattle.php | 5 +++ webapp/services/TameBattleDataService.php | 37 ++++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index b0f2ee77..3c41d4ca 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1073,7 +1073,7 @@ CREATE TABLE `t_rank_battle` ( `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel', `mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2:pvp', `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', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 2ebb7784..f1f55459 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -720,7 +720,7 @@ class BattleController extends BaseAuthedController { // $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc'); $data = array(); foreach ($historyList as $k=>$history){ - if ($k < 20){ + if ($k < 40){ array_push($data,BattleHistory::toDto($history)); } } diff --git a/webapp/models/RankBattle.php b/webapp/models/RankBattle.php index 41224886..4675549b 100644 --- a/webapp/models/RankBattle.php +++ b/webapp/models/RankBattle.php @@ -13,6 +13,11 @@ class RankBattle extends BaseModel const MVP_TIMES = 3; const TOP_THREE_TIMES = 4; 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 DAILY_CHARTS = 2; diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index 90d6afb9..3c458a8c 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -188,6 +188,31 @@ class TameBattleDataService extends BaseService { if (getXVal($this->battleInfo,'pvp_kill', 0) > 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; case self::ROOM_MODE_MOBA : { @@ -203,6 +228,18 @@ class TameBattleDataService extends BaseService { if (getXVal($this->battleInfo,'kills', 0) > 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)); + } } } From 609fdf82300443108486bdd10f1a665633e44fd5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 21 Apr 2024 18:56:49 +0800 Subject: [PATCH 6/7] 1 --- webapp/controller/BagController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index e2da21dd..74f54b0f 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -50,7 +50,7 @@ class BagController extends BaseAuthedController { public function createGuildConsume() { - $consume = explode("|",mt\Parameter::getVal('create_club_cost')); + $consume = explode("|",mt\Parameter::getVal('create_club_cost', '')); $costItems = array( array( 'item_id' => $consume[0], From 54de3d78b57681ccd9ca59a7fe908815f9ce88c8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Apr 2024 14:32:03 +0800 Subject: [PATCH 7/7] 1 --- webapp/controller/BaseController.class.php | 12 ++++++++++++ webapp/services/MsgQueueService.php | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 webapp/services/MsgQueueService.php diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 7ad36cfa..3bcb445e 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -8,6 +8,7 @@ class BaseController { private $marketDbConn = null; private $relationDbConn = null; private $timeOffset = 0; + private $serviceHash = array(); function __construct() { @@ -235,4 +236,15 @@ class BaseController { 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; + } + } diff --git a/webapp/services/MsgQueueService.php b/webapp/services/MsgQueueService.php new file mode 100644 index 00000000..329e7d87 --- /dev/null +++ b/webapp/services/MsgQueueService.php @@ -0,0 +1,11 @@ +