1
This commit is contained in:
parent
b70939b293
commit
3c35abb402
@ -44,6 +44,17 @@ CREATE TABLE `t_user` (
|
||||
`last_season_id` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次赛季id',
|
||||
`activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已激活',
|
||||
`activatetime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间',
|
||||
`total_battle_times` int(11) NOT NULL DEFAULT '0' COMMENT '总战斗次数',
|
||||
`total_win_times` int(11) NOT NULL DEFAULT '0' COMMENT '总胜利次数',
|
||||
`total_kills_times` int(11) NOT NULL DEFAULT '0' COMMENT '总击杀数',
|
||||
`max_kills_times` int(11) NOT NULL DEFAULT '0' COMMENT '最高击杀数',
|
||||
`total_damage_out` bigint NOT NULL DEFAULT '0' COMMENT '总伤害输出',
|
||||
`max_damage_out` bigint NOT NULL DEFAULT '0' COMMENT '最高伤害输出',
|
||||
`total_damage_in` bigint NOT NULL DEFAULT '0' COMMENT '总伤害输入',
|
||||
`total_recover_hp` bigint NOT NULL DEFAULT '0' COMMENT '总治疗量',
|
||||
`max_recover_hp` bigint NOT NULL DEFAULT '0' COMMENT '最高治疗量',
|
||||
`total_alive_time` bigint NOT NULL DEFAULT '0' COMMENT '总存活时间',
|
||||
`max_alive_time` bigint NOT NULL DEFAULT '0' COMMENT '最高存活时间',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
|
@ -25,50 +25,86 @@ class BattleController extends BaseAuthedController {
|
||||
{
|
||||
$userInfo = $this->_getOrmUserInfo();
|
||||
if (!$userInfo) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家1');
|
||||
$this->_rspErr(1, '没有这个玩家1');
|
||||
return;
|
||||
}
|
||||
$this->oldBattleReport($userInfo);
|
||||
$this->updateUserBaseInfo($userInfo);
|
||||
$this->updateSeason($userInfo);
|
||||
$this->updateMission($userInfo);
|
||||
$this->_rspOk();
|
||||
}
|
||||
|
||||
private function oldBattleReport($userInfo)
|
||||
private function updateUserBaseInfo($userInfo)
|
||||
{
|
||||
$map_id = isset($_REQUEST['map_id']) ? $_REQUEST['map_id'] : 0;
|
||||
$map_tpl_name = isset($_REQUEST['map_tpl_name']) ? $_REQUEST['map_tpl_name'] : '';
|
||||
$room_uuid = $_REQUEST['room_uuid']; //战斗id
|
||||
$map_name = $_REQUEST['map_name']; //地图名
|
||||
$game_time = $_REQUEST['game_time']; //游戏结束时间
|
||||
$hurt = $_REQUEST['hurt']; //承受伤害
|
||||
$rank = $_REQUEST['rank']; //排名
|
||||
$kills = $_REQUEST['kills']; //击杀数
|
||||
$harm = $_REQUEST['harm']; //伤害
|
||||
$add_HP = $_REQUEST['add_HP']; //治疗量
|
||||
$alive_time = $_REQUEST['alive_time']; //存活时间
|
||||
$team_status = $_REQUEST['team_status']; //是否是组队状态
|
||||
$snipe_kill = $_REQUEST['snipe_kill']; //狙击枪击杀数
|
||||
$rifle_kill = $_REQUEST['rifle_kill']; //步枪击杀数
|
||||
$pistol_kill = $_REQUEST['pistol_kill']; //手枪击杀数
|
||||
$submachine_kill = $_REQUEST['submachine_kill'];//冲锋枪击杀数
|
||||
$rescue_member = $_REQUEST['rescue_member']; //救起队友次数
|
||||
$kill_his = $kills;
|
||||
$harm_his = $harm;
|
||||
$alive_time_his = $alive_time;
|
||||
$add_HP_his = $add_HP;
|
||||
$coin_num = $_REQUEST['coin_num']; //金币
|
||||
$integral = $_REQUEST['rank_score']; //排位积分
|
||||
$score = $_REQUEST['pass_score']; //通行证积分
|
||||
$fieldsKv = array(
|
||||
'total_battle_times' => function () {
|
||||
return 'total_battle_times + 1';
|
||||
},
|
||||
);
|
||||
if (getReqVal('rank', 0) == 1) {
|
||||
$fieldsKv['total_win_times'] = function () {
|
||||
return 'total_win_times + 1';
|
||||
};
|
||||
}
|
||||
$kills = getReqVal('kills', 0);
|
||||
if ($kills > 0) {
|
||||
$fieldsKv['total_kills_times'] = function () {
|
||||
return "total_kills_times + ${kills}";
|
||||
};
|
||||
$fieldsKv['max_kills_times'] = function () {
|
||||
return "GREATEST(max_kills_times, ${kills})";
|
||||
};
|
||||
}
|
||||
$damageOut = getReqVal('damage_out', 0);
|
||||
if ($damageOut > 0) {
|
||||
$fieldsKv['total_damage_out'] = function () {
|
||||
return "total_damage_out + ${damageOut}";
|
||||
};
|
||||
$fieldsKv['max_damage_out'] = function () {
|
||||
return "GREATEST(max_damage_out, ${damageOut})";
|
||||
};
|
||||
}
|
||||
$damageIn = getReqVal('damage_in', 0);
|
||||
if ($damageIn > 0) {
|
||||
$fieldsKv['total_damage_in'] = function () {
|
||||
return "total_damage_in + ${damageIn}";
|
||||
};
|
||||
}
|
||||
$recoverHp = getReqVal('recover_hp', 0);
|
||||
if ($recoverHp > 0) {
|
||||
$fieldsKv['total_recover_hp'] = function () {
|
||||
return "total_recover_hp + ${recoverHp}";
|
||||
};
|
||||
$fieldsKv['max_recover_hp'] = function () {
|
||||
return "GREATEST(max_recover_hp, ${recoverHp})";
|
||||
};
|
||||
}
|
||||
$aliveTime = getReqVal('alive_time', 0);
|
||||
if ($aliveTime > 0) {
|
||||
$fieldsKv['total_alive_time'] = function () {
|
||||
return "total_alive_time + ${aliveTime}";
|
||||
};
|
||||
$fieldsKv['max_alive_time'] = function () {
|
||||
return "GREATEST(max_alive_time, ${aliveTime})";
|
||||
};
|
||||
}
|
||||
if (count($fieldsKv) > 0) {
|
||||
$this->_updateUserInfo($fieldsKv);
|
||||
}
|
||||
}
|
||||
|
||||
$nowDaySeconds = $this->_getNowDaySeconds();
|
||||
if ($_REQUEST['items'] != '') {
|
||||
$item_list = splitStr1($_REQUEST['items']);
|
||||
$addreward = new classes\AddReward();
|
||||
$addreward->addReward((int)$item_list[0][0], (int)$item_list[0][1], $this->_getAccountId(), 0, 0);
|
||||
}
|
||||
private function updateSeason($userInfo)
|
||||
{
|
||||
$addreward = new classes\AddReward();
|
||||
$val = $addreward->getVipVal($this->_getAccountId(), 1);
|
||||
$coin_num = floor($coin_num + $coin_num * $val / 100);
|
||||
|
||||
}
|
||||
|
||||
private function updateMission($userInfo)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function old()
|
||||
{
|
||||
//更新击杀信息时间
|
||||
$k = 0;
|
||||
if ($userInfo['game_times'] != 0) {
|
||||
@ -170,14 +206,9 @@ class BattleController extends BaseAuthedController {
|
||||
'sea_avg_kill' => function () use($kills) {
|
||||
return "sea_avg_kill + ${kills}"; //??
|
||||
},
|
||||
'newhand' => $newhand,
|
||||
'newhand2' => $newhand2,
|
||||
'game_times2' => $game_times2,
|
||||
'first_fight' => 1,
|
||||
));
|
||||
|
||||
$addreward = new classes\Addreward();
|
||||
$vip_level = $addreward->getVipLevel($this->_getAccountId());
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user