完善首战逻辑

This commit is contained in:
aozhiwei 2021-10-25 14:40:37 +08:00
parent 1682efaaf4
commit b9d8b539e0
3 changed files with 39 additions and 1 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ config
__pycache__/
res
out/
public/

View File

@ -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));

View File

@ -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()