From 263f1ce6b3af50d3c28121aab9c7307baf59a4d4 Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Fri, 12 Jul 2019 14:54:43 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 5 +- webapp/bootstrap/init.php | 27 +++--- .../controller/CommanderController.class.php | 11 ++- webapp/controller/RoleController.class.php | 53 ++++------ webapp/controller/SignController.class.php | 14 +-- webapp/controller/SkinController.class.php | 2 +- webapp/controller/TankController.class.php | 97 ++++++++----------- 7 files changed, 90 insertions(+), 119 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 995b265..d9a8469 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -45,14 +45,13 @@ CREATE TABLE `user` ( `win_times` int(11) NOT NULL COMMENT '胜场', `kills` int(11) NOT NULL COMMENT '所有击杀', `harm` int(11) NOT NULL COMMENT '所有伤害', - `add_HP` int(11) NOT NULL COMMENT '所有治疗量', + `score` bigint NOT NULL COMMENT '积分', `alive_time` int(11) NOT NULL COMMENT '所有生存时间', `coin_num` bigint NOT NULL COMMENT '角色金币', `diamond_num` bigint NOT NULL COMMENT '角色钻石', `kill_his` int(11) NOT NULL COMMENT '最高击杀', `alive_time_his` int(11) NOT NULL COMMENT '最长生存时间', `harm_his` int(11) NOT NULL COMMENT '最高伤害', - `add_HP_his` int(11) NOT NULL COMMENT '最多治疗量', `create_time` int(11) NOT NULL COMMENT '创建时间', `modify_time` int(11) NOT NULL COMMENT '修改时间', `first_fight` int(11) NOT NULL COMMENT '是否是第一次战斗', @@ -104,6 +103,8 @@ CREATE TABLE `tank` ( `tank_id` int(11) NOT NULL COMMENT '坦克id', `tank_status` int(11) NOT NULL COMMENT '坦克状态(0:上阵中,1:已获得,2:未获得)', `tank_level` int(11) NOT NULL COMMENT '坦克等级', + `fragment_id` int(11) NOT NULL COMMENT '碎片id', + `fragment_num` int(11) NOT NULL COMMENT '碎片数量', `experience_level` int(11) NOT NULL COMMENT '坦克体验等级', `experience_type` int(11) NOT NULL COMMENT '坦克体验类型', `active_time` varchar(50) NOT NULL DEFAULT '有效时间', diff --git a/webapp/bootstrap/init.php b/webapp/bootstrap/init.php index 0a75a96..c545d5c 100644 --- a/webapp/bootstrap/init.php +++ b/webapp/bootstrap/init.php @@ -9,31 +9,28 @@ define('QUEST_DAY_LOGIN', 71001); define('QUEST_DAY_SHARE', 71002); define('QUEST_DAY_FIGHT', 71003); define('QUEST_DAY_SUPPLY', 71004); -define('QUEST_DAY_UPDATEEQUIP', 71005); -define('QUEST_DAY_TEAM', 71006); +define('QUEST_DAY_UPDATETANK', 71005); +define('QUEST_DAY_UPDATEDRIVER', 71006); define('QUEST_DAY_RANK', 71007); define('QUEST_DAY_ALIVE', 71008); define('QUEST_DAY_HARM', 71009); define('QUEST_DAY_KILL', 71010); -define('QUEST_DAY_HELP', 71011); -define('QUEST_DAY_COMPLETE', 71012); +define('QUEST_DAY_COMPLETE', 71011); //成就 define('QUEST_SUM_LOGIN', 72001); define('QUEST_SUM_SHARE', 72002); define('QUEST_SUM_FIGHT', 72003); define('QUEST_SUM_SUPPLY', 72004); -define('QUEST_SUM_EQUIPMAX', 72005); -define('QUEST_SUM_TEAM', 72006); +define('QUEST_SUM_TANKMAX', 72005); +define('QUEST_SUM_DRIVER', 72006); define('QUEST_SUM_WIM', 72007); -define('QUEST_SUM_TEAMWIN', 72008); -define('QUEST_SUM_ALIVE', 72009); -define('QUEST_SUM_HARM', 72010); -define('QUEST_SUM_KILL', 72011); -define('QUEST_SUM_SNIPEKILL', 72012); -define('QUEST_SUM_RIFLEKILL', 72013); -define('QUEST_SUM_PISTOLKILL', 72014); -define('QUEST_SUM_SUBMACKILL', 72015); -define('QUEST_SUM_HELP', 72016); +define('QUEST_SUM_ALIVE', 72008); +define('QUEST_SUM_HARM', 72009); +define('QUEST_SUM_KILL', 72010); +define('QUEST_SUM_SKILL', 72011); +define('QUEST_SUM_TANK1KILL', 72012); +define('QUEST_SUM_TANK2KILL', 72013); +define('QUEST_SUM_TANK3KILL', 72014); //活动 define('QUEST_ACTIVITY_LOGIN', 83001); define('QUEST_ACTIVITY_GAME', 83002); diff --git a/webapp/controller/CommanderController.class.php b/webapp/controller/CommanderController.class.php index 63b452d..2001927 100644 --- a/webapp/controller/CommanderController.class.php +++ b/webapp/controller/CommanderController.class.php @@ -1,5 +1,7 @@ getCommander($row['commander_id']); if ($commander_id == $row['commander_id']) { @@ -377,13 +379,18 @@ class CommanderController{ ' WHERE accountid=:account_id;', array( ':account_id' => $account_id, - ':coin_num' => $row['coin_num'] - $coin_num, + ':coin_num' => $rowCoin['coin_num'] - $coin_num, ':modify_time' => time() )); if (!$retCoin) { die(); return; } + $quest = new classes\Quest(); + $quest->triggerQuest(QUEST_DAY_UPDATEDRIVER, 1, 1, $account_id); + if ($row['commander_level'] + 1 >= $c['max_lv']) { + $quest->triggerQuest(QUEST_DAY_UPDATEDRIVER, 2, 1, $account_id); + } echo json_encode(array( 'errcode' => 0, 'errmsg' => '', diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 763f7d9..c4524eb 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -83,9 +83,9 @@ class RoleController{ ':accountid' => $account_id )); if (!$row) { - $ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, diamond_num, kill_his, alive_time_his, harm_his, add_HP_his, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, free_getbox) ' . - ' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0) ' . - ' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, add_HP=0, alive_time=0, coin_num=0, diamond_num=0, kill_his=0, alive_time_his=0, harm_his=0, add_HP_his=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, free_getbox=0;', + $ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, score, alive_time, coin_num, diamond_num, kill_his, alive_time_his, harm_his, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, free_getbox) ' . + ' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0) ' . + ' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, score=0, alive_time=0, coin_num=0, diamond_num=0, kill_his=0, alive_time_his=0, harm_his=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, free_getbox=0;', array( ':accountid' => $account_id, ':user_name' => $user_name, @@ -106,7 +106,7 @@ class RoleController{ 'kills' => 0, 'high_harm' => 0, 'harm' => 0, - 'add_HP' => 0, + 'score' => 0, 'alive_time' => 0, 'coin_num' => 0, 'first_fight' => 0, @@ -126,7 +126,7 @@ class RoleController{ 'kills' => $row['kills'], 'high_harm' => $row['harm_his'], 'harm' => $row['harm'], - 'add_HP' => $row['add_HP'], + 'score' => $row['score'], 'alive_time' => $row['alive_time'], 'coin_num' => $row['coin_num'], 'first_fight' => $row['first_fight'], @@ -156,20 +156,17 @@ class RoleController{ $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'];//冲锋枪击杀数 + $skill = $_REQUEST['skill']; //技能释放数 + $tank1_kill = $_REQUEST['tank1_kill']; //坦克1击杀数 + $tank2_kill = $_REQUEST['tank2_kill']; //坦克2击杀数 + $tank3_kill = $_REQUEST['tank3_kill'];//坦克3击杀数 $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']; //金币 - // $diamond_num = $_REQUEST['score']; //积分 + $score = $_REQUEST['score']; //积分 if (!$map_id) { $map_id = 0; @@ -198,10 +195,7 @@ class RoleController{ 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, modify_time=:modify_time, first_fight=1 ' . + $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, score=:score, coin_num=:coin_num, modify_time=:modify_time, first_fight=1 ' . ' WHERE accountid=:accountid;', array( ':game_times' => $row['game_times'] + 1, @@ -213,9 +207,9 @@ class RoleController{ ':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, + ':score' => $row['score'] + $score, ':modify_time' => time() )); if (!$ret) { @@ -253,29 +247,21 @@ class RoleController{ $quest->triggerQuest(QUEST_DAY_ALIVE, 1, (int)($alive_time / 1000 / 60), $account_id); $quest->triggerQuest(QUEST_DAY_HARM, 1, $harm, $account_id); $quest->triggerQuest(QUEST_DAY_KILL, 1, $kills, $account_id); - $quest->triggerQuest(QUEST_DAY_HELP, 1, $rescue_member, $account_id); $quest->triggerQuest(QUEST_SUM_FIGHT, 2, 1, $account_id); $quest->triggerQuest(QUEST_SUM_ALIVE, 2, (int)($alive_time / 1000 / 60), $account_id); $quest->triggerQuest(QUEST_SUM_HARM, 2, $harm, $account_id); $quest->triggerQuest(QUEST_SUM_KILL, 2, $kills, $account_id); - $quest->triggerQuest(QUEST_SUM_HELP, 2, $rescue_member, $account_id); - $quest->triggerQuest(QUEST_SUM_SNIPEKILL, 2, $snipe_kill, $account_id); - $quest->triggerQuest(QUEST_SUM_RIFLEKILL, 2, $rifle_kill, $account_id); - $quest->triggerQuest(QUEST_SUM_PISTOLKILL, 2, $pistol_kill, $account_id); - $quest->triggerQuest(QUEST_SUM_SUBMACKILL, 2, $submachine_kill, $account_id); - if ($team_status == 1 && $rank <= 5) { + $quest->triggerQuest(QUEST_SUM_SKILL, 2, $skill, $account_id); + $quest->triggerQuest(QUEST_SUM_TANK1KILL, 2, $tank1_kill, $account_id); + $quest->triggerQuest(QUEST_SUM_TANK2KILL, 2, $tank2_kill, $account_id); + $quest->triggerQuest(QUEST_SUM_TANK3KILL, 2, $tank3_kill, $account_id); + if ($rank <= 5) { $quest->triggerQuest(QUEST_DAY_RANK, 1, 1, $account_id); } - if ($team_status == 0 && $rank == 1) { + if ($rank == 1) { $quest->triggerQuest(QUEST_SUM_WIM, 2, 1, $account_id); } - if ($team_status == 1) { - $quest->triggerQuest(QUEST_DAY_TEAM, 1, 1, $account_id); - $quest->triggerQuest(QUEST_SUM_TEAM, 2, 1, $account_id); - if ($rank == 1) { - $quest->triggerQuest(QUEST_SUM_TEAMWIN, 2, 1, $account_id); - } - } + //额外奖励 $times = $this->getRewardTimes($coin_num); $extra_coin = $coin_num * ($times - 1); @@ -317,7 +303,6 @@ class RoleController{ 'kill_his' => $kill_his, 'alive_time_his' => $alive_time_his, 'harm_his' => $harm_his, - 'add_HP_his' => $add_HP_his, 'extra_drop' => $extra_drop )); } diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index 5fe0d18..a66de50 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -107,13 +107,13 @@ class SignController{ $signable = 0; //刷新签到信息 $retSign = $conn->execScript('UPDATE sign SET sign_time=:sign_time, sign_days=:sign_days, modify_time=:modify_time ' . - ' WHERE accountid=:accountid;', - array( - ':accountid' => $account_id, - ':sign_days' => $sign_days, - ':sign_time' => time(), - ':modify_time' => time() - )); + ' WHERE accountid=:accountid;', + array( + ':accountid' => $account_id, + ':sign_days' => $sign_days, + ':sign_time' => time(), + ':modify_time' => time() + )); if (!$retSign) { die(); return; diff --git a/webapp/controller/SkinController.class.php b/webapp/controller/SkinController.class.php index 797ac0e..949b66e 100644 --- a/webapp/controller/SkinController.class.php +++ b/webapp/controller/SkinController.class.php @@ -179,7 +179,7 @@ class SkinController{ ' WHERE accountid=:account_id;', array( ':account_id' => $account_id, - ':diamond_num' => $row['diamond_num'] - $num, + ':diamond_num' => $rowDiamond['diamond_num'] - $num, ':modify_time' => time() )); if (!$retDiamond) { diff --git a/webapp/controller/TankController.class.php b/webapp/controller/TankController.class.php index be37ffb..fdbcbd3 100644 --- a/webapp/controller/TankController.class.php +++ b/webapp/controller/TankController.class.php @@ -1,5 +1,7 @@ $mysql_conf['port'], 'user' => $mysql_conf['user'], 'passwd' => $mysql_conf['passwd'], - 'dbname' => 'gamedb2001_' . $mysql_conf['instance_id'] + 'dbname' => 'gamedb2002_' . $mysql_conf['instance_id'] )); return $conn; } @@ -26,6 +28,8 @@ class TankController{ 'cost' => $tank_meta['cost'], 'cost_int' => $tank_meta['cost_int'], 'max_lv' => $tank_meta['max_lv'], + 'compose' => $skin_conf['compose'], + 'debris' => $skin_conf['debris'], ); return $t; } @@ -79,7 +83,7 @@ class TankController{ die(); } $ret = $conn->execScript('UPDATE tank SET skin_status=0, modify_time=:modify_time ' . - ' WHERE accountid=:account_id AND tank_id=20001;', + ' WHERE accountid=:account_id AND tank_id=15001;', array( ':account_id' => $row['accountid'], ':modify_time' => time() @@ -105,7 +109,7 @@ class TankController{ return; } $tank_meta_table = require('../res/tank@tank.php'); - $t = $this->getTank(20001); + $t = $this->getTank(15001); if(!$t){ phpcommon\sendError(ERR_USER_BASE + 1,'没有这个坦克'); return; @@ -116,23 +120,24 @@ class TankController{ ':account_id' => $account_id )); if ($rowCount == 0) { - for ($i = 20001; $i <= count($tank_meta_table) + 20000; $i++) { + for ($i = 15001; $i <= count($tank_meta_table) + 15000; $i++) { $t = $this->getTank($i); if (!$t) { phpcommon\sendError(ERR_USER_BASE + 1,'没有这个坦克'); return; } - if ($i == 20000) { + if ($i == 15001) { $tank_status = 0; } else { $tank_status = 2; } - $ret = $conn->execScript('INSERT INTO tank(accountid, tank_id, tank_status, active_time, tank_level, experience_level, experience_type, create_time, modify_time) ' . - ' VALUES(:account_id, :tank_id, :tank_status, 0, 1, 0, 0, :create_time, :modify_time) ' . - ' ON DUPLICATE KEY UPDATE accountid=:account_id, tank_id=:tank_id, tank_status=:tank_status, active_time=0, tank_level=1, experience_level=0, experience_type=0, modify_time=:modify_time;', + $ret = $conn->execScript('INSERT INTO tank(accountid, tank_id, tank_status, fragment_id, fragment_num, active_time, tank_level, experience_level, experience_type, create_time, modify_time) ' . + ' VALUES(:account_id, :tank_id, :tank_status, :fragment_id, 0, 0, 1, 0, 0, :create_time, :modify_time) ' . + ' ON DUPLICATE KEY UPDATE accountid=:account_id, tank_id=:tank_id, tank_status=:tank_status, fragment_id=:fragment_id, fragment_num=0, active_time=0, tank_level=1, experience_level=0, experience_type=0, modify_time=:modify_time;', array( ':account_id' => $account_id, ':tank_id' => $i, + ':fragment_id' => $t['debris'], ':tank_status' => $tank_status, ':create_time' => time(), ':modify_time' => time() @@ -167,15 +172,17 @@ class TankController{ } $tank_id = $rowTank['tank_id']; if ($rowTank['active_time'] != 0) { - $tank_level = $rowSkin['experience_level']; + $tank_level = $rowTank['experience_level']; } else { - $tank_level = $rowSkin['tank_level']; + $tank_level = $rowTank['tank_level']; } array_push($tank_list, array( 'tank_id' => $rowTank['tank_id'], 'tank_level' => $tank_level, 'active_time' => $rowTank['active_time'], 'tank_status' => $rowTank['tank_status'], + 'fragment_id' => $rowTank['fragment_id'], + 'fragment_num' => $rowTank['fragment_num'], )); } echo json_encode(array( @@ -206,7 +213,7 @@ class TankController{ phpcommon\sendError(ERR_USER_BASE + 2,'没有这个坦克'); return; } - $row = $conn->execQueryOne('SELECT tank_status FROM tank WHERE accountid=:account_id AND tank_id=:tank_id;', + $row = $conn->execQueryOne('SELECT tank_status, fragment_num, fragment_id FROM tank WHERE accountid=:account_id AND tank_id=:tank_id;', array( ':account_id' => $account_id, ':tank_id' => $tank_id @@ -219,36 +226,19 @@ class TankController{ phpcommon\sendError(ERR_USER_BASE + 4,'坦克已解锁'); return; } - $num = $t['price']; - $rowDiamond = $conn->execQueryOne('SELECT diamond_num FROM user WHERE accountid=:account_id;', - array( - ':account_id' => $account_id, - )); - if (!$rowDiamond) { - phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); + $num = 0; + $array = $this->getExplode($t['compose']); + if ($row['fragment_num'] < $array[0][1]) { + phpcommon\sendError(ERR_USER_BASE + 2,'坦克碎片数量不足'); return; } - if ($num > $rowDiamond['diamond_num']) { - phpcommon\sendError(ERR_USER_BASE + 5, '钻石不足'); - return; - } - $retDiamond = $conn->execScript('UPDATE user SET diamond_num=:diamond_num, modify_time=:modify_time ' . - ' WHERE accountid=:account_id;', - array( - ':account_id' => $account_id, - ':diamond_num' => $row['diamond_num'] - $num, - ':modify_time' => time() - )); - if (!$retDiamond) { - die(); - return; - } - - $ret = $conn->execScript('UPDATE tank SET tank_status=1, modify_time=:modify_time ' . + $fragment_num = $row['fragment_num'] - $array[0][1]; + $ret = $conn->execScript('UPDATE tank SET tank_status=1, fragment_num=:fragment_num, modify_time=:modify_time ' . ' WHERE accountid=:account_id AND tank_id=:tank_id;', array( ':account_id' => $account_id, ':tank_id' => $tank_id, + ':fragment_num' => $fragment_num, ':modify_time' => time() )); if (!$ret) { @@ -259,7 +249,9 @@ class TankController{ 'errcode' => 0, 'errmsg' => '', "tank_id" => $tank_id, - "tank_status" => $tank_status, + "tank_status" => 1, + "fragment_id" => $row['fragment_id'], + "fragment_num" => $fragment_num, )); } @@ -423,7 +415,7 @@ class TankController{ } $tank_id = $_REQUEST['tank_id']; $free = $_REQUEST['free']; - $row = $conn->execQueryOne('SELECT tank_level FROM tank WHERE accountid=:account_id AND tank_id=:tank_id;', + $row = $conn->execQueryOne('SELECT tank_level, fragment_num, fragment_id FROM tank WHERE accountid=:account_id AND tank_id=:tank_id;', array( ':account_id' => $account_id, ':tank_id' => $tank_id @@ -441,31 +433,12 @@ class TankController{ phpcommon\sendError(ERR_USER_BASE + 3, '坦克已到满级'); return; } - $rowCoin = $conn->execQueryOne('SELECT coin_num FROM user WHERE accountid=:account_id;', - array( - ':account_id' => $account_id, - )); - if (!$rowCoin) { - phpcommon\sendError(ERR_USER_BASE + 1, '指挥官不存在'); - return; - } $coin_num = $t['cost'] * ceil($row['tank_level'] / 5) + $t['cost_int']; if ($free == 1) { $coin_num = 0; } - if ($coin_num > $rowCoin['coin_num']) { - phpcommon\sendError(ERR_USER_BASE + 6, '金币不足'); - return; - } - $retCoin = $conn->execScript('UPDATE user SET coin_num=:coin_num, modify_time=:modify_time ' . - ' WHERE accountid=:account_id;', - array( - ':account_id' => $account_id, - ':coin_num' => $row['coin_num'] - $coin_num, - ':modify_time' => time() - )); - if (!$retCoin) { - die(); + if ($coin_num > $row['fragment_num'] ){ + phpcommon\sendError(ERR_USER_BASE + 4, '坦克碎片数量不足'); return; } $ret = $conn->execScript('UPDATE tank SET tank_level=:tank_level, modify_time=:modify_time ' . @@ -474,17 +447,25 @@ class TankController{ ':account_id' => $account_id, ':tank_id' => $tank_id, ':tank_level' => $row['tank_level'] + 1, + ':fragment_num' => $row['fragment_num'] - $coin_num, ':modify_time' => time() )); if (!$ret) { die(); return; } + $quest = new classes\Quest(); + $quest->triggerQuest(QUEST_DAY_UPDATETANK, 1, 1, $account_id); + if ($row['tank_level'] + 1 >= $t['max_lv']) { + $quest->triggerQuest(QUEST_SUM_TANKMAX, 2, 1, $account_id); + } echo json_encode(array( 'errcode' => 0, 'errmsg' => '', 'tank_id' => $row['tank_id'], 'tank_level' => $row['tank_level'] + 1, + "fragment_id" => $row['fragment_id'], + "fragment_num" => $row['fragment_num'] - $coin_num, )); } }