1
This commit is contained in:
parent
68cd3da524
commit
499ef5db53
@ -102,7 +102,10 @@ class GameOverController{
|
|||||||
'parameter' => $rank_meta['parameter'],
|
'parameter' => $rank_meta['parameter'],
|
||||||
'drop' => $rank_meta['drop'],
|
'drop' => $rank_meta['drop'],
|
||||||
'ad_drop' => $rank_meta['ad_drop'],
|
'ad_drop' => $rank_meta['ad_drop'],
|
||||||
'ad_num' => $rank_meta['ad_num']
|
'ad_num' => $rank_meta['ad_num'],
|
||||||
|
'js_num' => $rank_meta['js_num'],
|
||||||
|
'js_drop' => $rank_meta['js_drop'],
|
||||||
|
'zbmode_param' => $rank_meta['zbmode_param'],
|
||||||
);
|
);
|
||||||
return $d;
|
return $d;
|
||||||
}
|
}
|
||||||
@ -124,34 +127,23 @@ class GameOverController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$rank = $_REQUEST['rank'];
|
$rank = $_REQUEST['rank'];
|
||||||
//$id = 12120;
|
$type = 0;
|
||||||
// $conn = $this->getMysql($account_id);
|
$coin = 0;
|
||||||
// if (!$conn) {
|
$score = 0;
|
||||||
// phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
$kills = 0;
|
||||||
// die();
|
if (isset($_REQUEST['type'])) {
|
||||||
// return;
|
$type = $_REQUEST['type'];
|
||||||
// }
|
}
|
||||||
// $row = $conn->execQueryOne('SELECT id FROM equip WHERE accountid=:account_id;',
|
if ($type == 1) {
|
||||||
// array(
|
$ar = $this->getRankReward($rank);
|
||||||
// ':account_id' => $account_id
|
$coin = $ar['zbmode_param'];
|
||||||
// ));
|
if (isset($_REQUEST['kills'])) {
|
||||||
// if ($row) {
|
$score = $_REQUEST['kills'] * 10;
|
||||||
// $id = $row['id'];
|
}
|
||||||
// }
|
}
|
||||||
// $e = $this->getEquip($id);
|
|
||||||
// if (!$e) {
|
|
||||||
// phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
|
|
||||||
// die();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// $count = 3;
|
|
||||||
// if ($e['upgrade_priority'] == 1) {
|
|
||||||
// $count = 1;
|
|
||||||
// }
|
|
||||||
//道具物品
|
//道具物品
|
||||||
$first_list = array();
|
$first_list = array();
|
||||||
//$first_list = $this->fixReward($first_list);
|
$first_list = $this->randomReward($rank, $type);
|
||||||
$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,
|
||||||
@ -164,6 +156,8 @@ class GameOverController{
|
|||||||
'errmsg'=> '',
|
'errmsg'=> '',
|
||||||
'first_uuid' => $first_uuid,
|
'first_uuid' => $first_uuid,
|
||||||
'item_list' => $first_list,
|
'item_list' => $first_list,
|
||||||
|
'coin' => $coin,
|
||||||
|
'score' => $score,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,20 +241,20 @@ class GameOverController{
|
|||||||
return $item_list;
|
return $item_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function randomReward($rank)
|
protected function randomReward($rank,$type)
|
||||||
{
|
{
|
||||||
//随机奖励
|
//随机奖励
|
||||||
//$e = $this->getEquip($id);
|
|
||||||
$r = $this->getRankReward($rank);
|
$r = $this->getRankReward($rank);
|
||||||
$b = $this->getDrop($r['ad_drop']);
|
$b = $this->getDrop($r['ad_drop']);
|
||||||
$count = $r['ad_num'];
|
$count = $r['ad_num'];
|
||||||
|
if ($type == 1) {
|
||||||
|
$b = $this->getDrop($r['js_drop']);
|
||||||
|
$count = $r['js_num'];
|
||||||
|
}
|
||||||
$item_list = array();
|
$item_list = array();
|
||||||
//$b = $this->getbox(6);
|
|
||||||
//$count = 3;
|
|
||||||
$item_id_array = $this->getExplode($b['item_id']);
|
$item_id_array = $this->getExplode($b['item_id']);
|
||||||
$item_num_array = $this->getExplode($b['num']);
|
$item_num_array = $this->getExplode($b['num']);
|
||||||
$weight_array = $this->getExplode($b['weight']);
|
$weight_array = $this->getExplode($b['weight']);
|
||||||
//$time_array = $this->getExplode($b['time']);
|
|
||||||
$reward_array = array();
|
$reward_array = array();
|
||||||
for ($c = 0; $c < $count; $c++) {
|
for ($c = 0; $c < $count; $c++) {
|
||||||
$weight_sum = 0;
|
$weight_sum = 0;
|
||||||
@ -268,18 +262,15 @@ class GameOverController{
|
|||||||
for ($ii = 0; $ii < count($weight_array); $ii++) {
|
for ($ii = 0; $ii < count($weight_array); $ii++) {
|
||||||
$flag = $this->removal($reward_array, $item_id_array[$ii][0]);
|
$flag = $this->removal($reward_array, $item_id_array[$ii][0]);
|
||||||
if ($flag == 1) {
|
if ($flag == 1) {
|
||||||
//error_log(222222222);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$weight_sum += $weight_array[$ii][0];
|
$weight_sum += $weight_array[$ii][0];
|
||||||
}
|
}
|
||||||
$random = Rand(0, $weight_sum);
|
$random = Rand(0, $weight_sum);
|
||||||
$weight = 0;
|
$weight = 0;
|
||||||
//error_log(json_encode($weight_array));
|
|
||||||
for ($ii = 0; $ii < count($weight_array); $ii++) {
|
for ($ii = 0; $ii < count($weight_array); $ii++) {
|
||||||
$flag = $this->removal($reward_array, $item_id_array[$ii][0]);
|
$flag = $this->removal($reward_array, $item_id_array[$ii][0]);
|
||||||
if ($flag == 1) {
|
if ($flag == 1) {
|
||||||
//error_log(1111111);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$weight += $weight_array[$ii][0];
|
$weight += $weight_array[$ii][0];
|
||||||
@ -300,7 +291,6 @@ class GameOverController{
|
|||||||
'time' => $time
|
'time' => $time
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
//error_log(json_encode($item_list));
|
|
||||||
return $item_list;
|
return $item_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +126,23 @@ class RoleController{
|
|||||||
return $seaPoint;
|
return $seaPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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'],
|
||||||
|
'js_num' => $rank_meta['js_num'],
|
||||||
|
'js_drop' => $rank_meta['js_drop'],
|
||||||
|
'zbmode_param' => $rank_meta['zbmode_param'],
|
||||||
|
);
|
||||||
|
return $d;
|
||||||
|
}
|
||||||
|
|
||||||
public function roleInfo()
|
public function roleInfo()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
@ -592,6 +609,72 @@ class RoleController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function battleReport()
|
public function battleReport()
|
||||||
|
{
|
||||||
|
if (!isset($_REQUEST['room_mode']) || $_REQUEST['room_mode'] == 0) {
|
||||||
|
$this->oldBattleReport();
|
||||||
|
} else {
|
||||||
|
$this->bioBattleReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bioBattleReport()
|
||||||
|
{
|
||||||
|
$account_id = $_REQUEST['account_id']; //账号
|
||||||
|
$conn = $this->getMysql($account_id);
|
||||||
|
if (!$conn) {
|
||||||
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$rank = $_REQUEST['rank'];
|
||||||
|
$ar = $this->getRankReward($rank);
|
||||||
|
$coin_num = $ar['zbmode_param'];
|
||||||
|
$row = $conn->execQueryOne('SELECT newhand, game_times, vip_score, daily_time, coin_num, season_games FROM user WHERE accountid=:accountid;',
|
||||||
|
array(
|
||||||
|
':accountid' => $account_id
|
||||||
|
));
|
||||||
|
if (!$row) {
|
||||||
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家1');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$newhand = $row['newhand'];
|
||||||
|
$p1 = $this->getParameter(NEWHAND_NUM1);
|
||||||
|
$fight_times = $p1['param_value'];
|
||||||
|
$p2 = $this->getParameter(NEWHAND_NUM2);
|
||||||
|
$view_times = $p2['param_value'];
|
||||||
|
if ($row['game_times'] + 1 == $fight_times && $row['vip_score'] >= $view_times) {
|
||||||
|
$newhand = 1;
|
||||||
|
}
|
||||||
|
$nowTime = phpcommon\getdayseconds(time());
|
||||||
|
$daily_time = $row['daily_time'];
|
||||||
|
if ($daily_time == 0 || ($nowTime - phpcommon\getdayseconds($daily_time) > 0)) {
|
||||||
|
$daily_time = time();
|
||||||
|
}
|
||||||
|
$ret = $conn->execScript('UPDATE user SET game_times=:game_times, coin_num=:coin_num, modify_time=:modify_time, first_fight=1, season_games=:season_games, newhand=:newhand, daily_time=:daily_time ' .
|
||||||
|
'WHERE accountid=:accountid;',
|
||||||
|
array(
|
||||||
|
':game_times' => $row['game_times'] + 1,
|
||||||
|
':accountid' => $account_id,
|
||||||
|
':coin_num' => $row['coin_num'] + $coin_num,
|
||||||
|
':modify_time' => time(),
|
||||||
|
':daily_time' => $daily_time,
|
||||||
|
':season_games' => $row['season_games'] + 1,
|
||||||
|
':newhand' => $newhand,
|
||||||
|
));
|
||||||
|
if (!$ret) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//刷新任务
|
||||||
|
$quest = new classes\Quest();
|
||||||
|
$quest->triggerQuest(QUEST_DAY_FIGHT, 1, 1, $account_id);
|
||||||
|
|
||||||
|
echo json_encode(array(
|
||||||
|
'errcode' => 0,
|
||||||
|
'errmsg' => '',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function oldBattleReport()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id']; //账号
|
$account_id = $_REQUEST['account_id']; //账号
|
||||||
$conn = $this->getMysql($account_id);
|
$conn = $this->getMysql($account_id);
|
||||||
|
@ -42,6 +42,7 @@ class TeamController{
|
|||||||
$hat_id = 0;
|
$hat_id = 0;
|
||||||
$rank = 1;
|
$rank = 1;
|
||||||
$equip_id = 0;
|
$equip_id = 0;
|
||||||
|
$model = false;
|
||||||
if (isset($_REQUEST['cloth_id'])) {
|
if (isset($_REQUEST['cloth_id'])) {
|
||||||
$cloth_id = $_REQUEST['cloth_id'];
|
$cloth_id = $_REQUEST['cloth_id'];
|
||||||
}
|
}
|
||||||
@ -60,6 +61,9 @@ class TeamController{
|
|||||||
if (isset($_REQUEST['equip_id'])) {
|
if (isset($_REQUEST['equip_id'])) {
|
||||||
$equip_id = $_REQUEST['equip_id'];
|
$equip_id = $_REQUEST['equip_id'];
|
||||||
}
|
}
|
||||||
|
if (isset($_REQUEST['model'])) {
|
||||||
|
$model = $_REQUEST['model'];
|
||||||
|
}
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
$conn = $this->getMysql($account_id);
|
$conn = $this->getMysql($account_id);
|
||||||
$row = $conn->execQueryOne('SELECT game_times, win_times, kills, create_time FROM user WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne('SELECT game_times, win_times, kills, create_time FROM user WHERE accountid=:accountid;',
|
||||||
@ -71,6 +75,7 @@ class TeamController{
|
|||||||
'team_uuid' => $team_uuid,
|
'team_uuid' => $team_uuid,
|
||||||
'auto_fill' => $_REQUEST['auto_fill'],
|
'auto_fill' => $_REQUEST['auto_fill'],
|
||||||
'state' => 0,
|
'state' => 0,
|
||||||
|
'model' => $model,
|
||||||
'member_list' => array(
|
'member_list' => array(
|
||||||
array(
|
array(
|
||||||
'idx' => 1,
|
'idx' => 1,
|
||||||
@ -148,6 +153,7 @@ class TeamController{
|
|||||||
'auto_fill' => $user_db['auto_fill'],
|
'auto_fill' => $user_db['auto_fill'],
|
||||||
'state' => $user_db['state'],
|
'state' => $user_db['state'],
|
||||||
'member_list' => $member_list,
|
'member_list' => $member_list,
|
||||||
|
'model' => $user_db['model'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user