1
This commit is contained in:
parent
5c94b86b61
commit
9b481b8c86
@ -219,5 +219,11 @@ function getRecommendConfig($rec_table, $rec_id)
|
|||||||
$rec_id = (int)$rec_id;
|
$rec_id = (int)$rec_id;
|
||||||
return array_key_exists($rec_id, $rec_table) ? $rec_table[$rec_id] : null;
|
return array_key_exists($rec_id, $rec_table) ? $rec_table[$rec_id] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRankRewardConfig($ran_table, $ran_id)
|
||||||
|
{
|
||||||
|
$ran_id = (int)$ran_id;
|
||||||
|
return array_key_exists($ran_id, $ran_table) ? $ran_table[$ran_id] : null;
|
||||||
|
}
|
||||||
checkMysqlConfig();
|
checkMysqlConfig();
|
||||||
checkRedisConfig();
|
checkRedisConfig();
|
||||||
|
@ -93,6 +93,20 @@ class GameOverController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function getRankReward($rank)
|
||||||
|
{
|
||||||
|
$rank_meta_table = require('../res/rankReward@rankReward.php');
|
||||||
|
$rank_meta = getRankRewardConfig($rank_meta_table, $rank);
|
||||||
|
$d = array(
|
||||||
|
'rank' => $rank_meta['rank'],
|
||||||
|
'parameter' => $rank_meta['parameter'],
|
||||||
|
'drop' => $rank_meta['drop'],
|
||||||
|
'ad_drop' => $rank_meta['ad_drop'],
|
||||||
|
'ad_num' => $rank_meta['ad_num']
|
||||||
|
);
|
||||||
|
return $d;
|
||||||
|
}
|
||||||
|
|
||||||
public function firstRewardInfo()
|
public function firstRewardInfo()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
@ -109,34 +123,35 @@ class GameOverController{
|
|||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$id = 12120;
|
$rank = $_REQUEST['rank'];
|
||||||
$conn = $this->getMysql($account_id);
|
//$id = 12120;
|
||||||
if (!$conn) {
|
// $conn = $this->getMysql($account_id);
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
// if (!$conn) {
|
||||||
die();
|
// phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
// die();
|
||||||
}
|
// return;
|
||||||
$row = $conn->execQueryOne('SELECT id FROM equip WHERE accountid=:account_id;',
|
// }
|
||||||
array(
|
// $row = $conn->execQueryOne('SELECT id FROM equip WHERE accountid=:account_id;',
|
||||||
':account_id' => $account_id
|
// array(
|
||||||
));
|
// ':account_id' => $account_id
|
||||||
if ($row) {
|
// ));
|
||||||
$id = $row['id'];
|
// if ($row) {
|
||||||
}
|
// $id = $row['id'];
|
||||||
$e = $this->getEquip($id);
|
// }
|
||||||
if (!$e) {
|
// $e = $this->getEquip($id);
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
|
// if (!$e) {
|
||||||
die();
|
// phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
|
||||||
return;
|
// die();
|
||||||
}
|
// return;
|
||||||
$count = 3;
|
// }
|
||||||
if ($e['upgrade_priority'] == 1) {
|
// $count = 3;
|
||||||
$count = 1;
|
// if ($e['upgrade_priority'] == 1) {
|
||||||
}
|
// $count = 1;
|
||||||
|
// }
|
||||||
//道具物品
|
//道具物品
|
||||||
$first_list = array();
|
$first_list = array();
|
||||||
$first_list = $this->fixReward($first_list);
|
//$first_list = $this->fixReward($first_list);
|
||||||
$first_list = $this->randomReward($first_list, $id, $count);
|
$first_list = $this->randomReward($rank);
|
||||||
$first_db = array(
|
$first_db = array(
|
||||||
'first_uuid' => $first_uuid,
|
'first_uuid' => $first_uuid,
|
||||||
'first_list' => $first_list,
|
'first_list' => $first_list,
|
||||||
@ -232,13 +247,14 @@ class GameOverController{
|
|||||||
return $item_list;
|
return $item_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function randomReward($item_list, $id, $count)
|
protected function randomReward($rank)
|
||||||
{
|
{
|
||||||
//随机奖励
|
//随机奖励
|
||||||
$e = $this->getEquip($id);
|
//$e = $this->getEquip($id);
|
||||||
$b = $this->getDrop($e['drop_id']);
|
$r = $this->getRankReward($rank);
|
||||||
|
$b = $this->getDrop($r['ad_drop']);
|
||||||
|
$count = $r['ad_num'];
|
||||||
|
$item_list = array();
|
||||||
//$b = $this->getbox(6);
|
//$b = $this->getbox(6);
|
||||||
//$count = 3;
|
//$count = 3;
|
||||||
$item_id_array = $this->getExplode($b['item_id']);
|
$item_id_array = $this->getExplode($b['item_id']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user