1
This commit is contained in:
parent
876c7718be
commit
b408be64c8
@ -218,7 +218,6 @@ class ActivityController{
|
|||||||
}
|
}
|
||||||
case 2: //活动皮肤兑换
|
case 2: //活动皮肤兑换
|
||||||
{
|
{
|
||||||
var_dump(time());
|
|
||||||
$arr = $this->getExplode($act['exchange_item']);
|
$arr = $this->getExplode($act['exchange_item']);
|
||||||
$row = $conn->execQueryOne('SELECT * FROM skin WHERE accountid = :account_id AND skin_id = :skin_id;',
|
$row = $conn->execQueryOne('SELECT * FROM skin WHERE accountid = :account_id AND skin_id = :skin_id;',
|
||||||
array(
|
array(
|
||||||
|
@ -121,7 +121,12 @@ class HangController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$num = time() - $row['hang_time'];
|
$p_num = $this->getParameter(GOLD);
|
||||||
|
$p_time_limit = $this->getParameter(TIME_LIMIT);
|
||||||
|
$num = time() - $row['hang_time'] / 5 * $p_num['param_value'];
|
||||||
|
if ($num >= $p_time_limit['param_value']) {
|
||||||
|
$num = $p_time_limit['param_value'] / 5 * $p_num['param_value'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
|
@ -169,44 +169,47 @@ class RoleController{
|
|||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
));
|
||||||
if ($row) {
|
if (!$row) {
|
||||||
if ($kill_his < $row['kill_his']) {
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
$kill_his = $row['kill_his'];
|
return;
|
||||||
}
|
|
||||||
if ($harm_his < $row['harm_his']) {
|
|
||||||
$harm_his = $row['harm_his'];
|
|
||||||
}
|
|
||||||
if ($rank == 1) {
|
|
||||||
$row['win_times']++;
|
|
||||||
}
|
|
||||||
if ($alive_time_his < $row['alive_time_his']) {
|
|
||||||
$alive_time_his = $row['alive_time_his'];
|
|
||||||
}
|
|
||||||
if ($add_HP_his < $row['add_HP_his']) {
|
|
||||||
$add_HP_his = $row['add_HP_his'];
|
|
||||||
}
|
|
||||||
$ret = $conn->execScript('UPDATE user SET game_times=:game_times, win_times=:win_times, kills=:kills, harm=:harm, add_HP=:add_HP, alive_time=:alive_time, kill_his=:kill_his, alive_time_his=:alive_time_his, harm_his=:harm_his, add_HP_his=:add_HP_his, coin_num=:coin_num, integral=:integral ' .
|
|
||||||
' WHERE accountid=:accountid;',
|
|
||||||
array(
|
|
||||||
':game_times' => $row['game_times'] + 1,
|
|
||||||
':win_times' => $row['win_times'],
|
|
||||||
':kill_his' => $kill_his,
|
|
||||||
':kills' => $row['kills'] + $kills,
|
|
||||||
':harm_his' => $harm_his,
|
|
||||||
':harm' => $row['harm'] + $harm,
|
|
||||||
':add_HP' => $row['add_HP'] + $add_HP,
|
|
||||||
':alive_time' => $row['alive_time'] + $alive_time,
|
|
||||||
':alive_time_his' => $alive_time_his,
|
|
||||||
':add_HP_his' => $add_HP_his,
|
|
||||||
':accountid' => $account_id,
|
|
||||||
':coin_num' => $row['coin_num'] + $coin_num,
|
|
||||||
':integral' => $row['integral'] + $integral
|
|
||||||
));
|
|
||||||
if (!$ret) {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($kill_his < $row['kill_his']) {
|
||||||
|
$kill_his = $row['kill_his'];
|
||||||
|
}
|
||||||
|
if ($harm_his < $row['harm_his']) {
|
||||||
|
$harm_his = $row['harm_his'];
|
||||||
|
}
|
||||||
|
if ($rank == 1) {
|
||||||
|
$row['win_times']++;
|
||||||
|
}
|
||||||
|
if ($alive_time_his < $row['alive_time_his']) {
|
||||||
|
$alive_time_his = $row['alive_time_his'];
|
||||||
|
}
|
||||||
|
if ($add_HP_his < $row['add_HP_his']) {
|
||||||
|
$add_HP_his = $row['add_HP_his'];
|
||||||
|
}
|
||||||
|
$ret = $conn->execScript('UPDATE user SET game_times=:game_times, win_times=:win_times, kills=:kills, harm=:harm, add_HP=:add_HP, alive_time=:alive_time, kill_his=:kill_his, alive_time_his=:alive_time_his, harm_his=:harm_his, add_HP_his=:add_HP_his, coin_num=:coin_num, integral=:integral ' .
|
||||||
|
' WHERE accountid=:accountid;',
|
||||||
|
array(
|
||||||
|
':game_times' => $row['game_times'] + 1,
|
||||||
|
':win_times' => $row['win_times'],
|
||||||
|
':kill_his' => $kill_his,
|
||||||
|
':kills' => $row['kills'] + $kills,
|
||||||
|
':harm_his' => $harm_his,
|
||||||
|
':harm' => $row['harm'] + $harm,
|
||||||
|
':add_HP' => $row['add_HP'] + $add_HP,
|
||||||
|
':alive_time' => $row['alive_time'] + $alive_time,
|
||||||
|
':alive_time_his' => $alive_time_his,
|
||||||
|
':add_HP_his' => $add_HP_his,
|
||||||
|
':accountid' => $account_id,
|
||||||
|
':coin_num' => $row['coin_num'] + $coin_num,
|
||||||
|
':integral' => $row['integral'] + $integral
|
||||||
|
));
|
||||||
|
if (!$ret) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//插入历史记录
|
//插入历史记录
|
||||||
$ret = $conn->execScript('INSERT INTO history_record(accountid, room_uuid, map_name, game_time, rank, kills, harms, hurts, alive_time, coin, status) ' .
|
$ret = $conn->execScript('INSERT INTO history_record(accountid, room_uuid, map_name, game_time, rank, kills, harms, hurts, alive_time, coin, status) ' .
|
||||||
' VALUES(:accountid, :room_uuid, :map_name, :game_time, :rank, :kills, :harms, :hurts, :alive_time, :coin, 0);',
|
' VALUES(:accountid, :room_uuid, :map_name, :game_time, :rank, :kills, :harms, :hurts, :alive_time, :coin, 0);',
|
||||||
|
@ -152,19 +152,21 @@ class SupplyBoxController{
|
|||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':box_id' => $box_id
|
':box_id' => $box_id
|
||||||
));
|
));
|
||||||
if (!$row && $free_open == 0) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱');
|
if ($free_open == 0) {
|
||||||
return;
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱');
|
||||||
} else if (!$row && $free_open == 1) {
|
return;
|
||||||
$ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' .
|
} else if ($free_open == 1) {
|
||||||
|
$ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' .
|
||||||
' VALUES(:accountid, :box_id, 0, 0, 0);',
|
' VALUES(:accountid, :box_id, 0, 0, 0);',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':box_id' => $box_id,
|
':box_id' => $box_id,
|
||||||
));
|
));
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($free_open == 0) {
|
if ($free_open == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user