diff --git a/.gitignore b/.gitignore index bf9fe5f..68f6149 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ config __pycache__/ res out/ +public/ \ No newline at end of file diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 37f0325..9eebeae 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -79,6 +79,29 @@ class BaseAuthedController extends BaseController { return $r; } + protected function rspErr($errno, $errmsg) + { + echo json_encode(array( + 'errno' => $errno, + 'errmsg' => $errmsg + )); + } + + protected function rspOk() + { + echo json_encode(array( + 'errno' => 0, + 'errmsg' => '' + )); + } + + protected function rspData($data) + { + $data['errno'] = 0; + $data['errmsg'] = ''; + echo json_encode($data); + } + protected function isValidSex($sex) { return in_array($sex, array(0, 1, 2)); diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index edc1d96..e2d9208 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -640,6 +640,20 @@ class RoleController extends BaseAuthedController { phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); return; } + phpcommon\SqlHelerp::update + ($conn, + 'user', + array( + 'accountid' => $account_id, + ), + array( + 'first_fight' => function () { + return '1'; + } + ) + ); + $this->rspOk(); + /* $rank = $_REQUEST['rank']; //排名 $kills = $_REQUEST['kills']; //击杀数 $harm = $_REQUEST['harm']; //伤害 @@ -809,7 +823,7 @@ class RoleController extends BaseAuthedController { 'errcode' => 0, 'errmsg' => '', )); - + */ } public function battleReport()