This commit is contained in:
aozhiwei 2020-11-11 17:59:58 +08:00
parent b139249b53
commit 01d9795ebd
4 changed files with 57 additions and 26 deletions

2
res
View File

@ -1 +1 @@
config
../conf_test/game2004api/webapp/res2001_5991

View File

@ -103,5 +103,41 @@ class FriendController{
'errmsg' => '',
));
}
public function changeRoleInfo()
{
$account_id = $_REQUEST['account_id'];
//登录校验
$login = loginVerify($account_id, $_REQUEST['session_id']);
if (!$login) {
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
return;
}
$conn = $this->getMysql($account_id);
if (!$conn) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return;
}
$user_name = $_REQUEST['user_name'];
$avatar_url = $_REQUEST['avatar_url'];
$ret = $conn->execScript('UPDATE user SET user_name=:user_name, avatar_url=:avatar_url, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':user_name' => $user_name,
':avatar_url' => $avatar_url,
':modify_time' => time(),
':accountid' => $account_id
));
if (!$ret) {
die();
return;
}
echo json_encode(array(
'errcode' => 0,
'errmsg' => '',
'user_name' => $user_name,
'avatar_url' => $avatar_url,
));
}
}
?>

View File

@ -146,8 +146,8 @@ class RoleController{
public function roleInfo()
{
$account_id = $_REQUEST['account_id'];
$user_name = $_REQUEST['name'];
$avatar_url = $_REQUEST['avatar_url'];
$user_name = '突击队员';
$avatar_url = '1';
$switch_id = 1;
$switch_id = isset($_REQUEST['switch_id']);
//登录校验
@ -247,28 +247,10 @@ class RoleController{
'act_video_status' => 0,
'act_ad_status' => 0,
'biogame_times' => 0,
'user_name' => $user_name,
'avatar_url' => $avatar_url,
));
} else {
if ($avatar_url != '') {
if ($user_name != $row['user_name']) {
$ret = $conn->execScript('UPDATE user SET user_name=:user_name, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':user_name' => $user_name,
':modify_time' => time()
));
}
if ($avatar_url != $row['avatar_url']) {
$ret = $conn->execScript('UPDATE user SET avatar_url=:avatar_url, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':avatar_url' => $avatar_url,
':modify_time' => time()
));
}
}
$nowTime = phpcommon\getdayseconds(time());
$daily_first_login = $row['daily_first_login'];
$coin_times = $row['coin_times'];
@ -359,6 +341,8 @@ class RoleController{
'act_video_status' => $row['act_video_status'],
'act_ad_status' => $act_ad_status,
'biogame_times' => $row['biogame_times'],
'user_name' => $row['user_name'],
'avatar_url' => $row['avatar_url'],
));
}
}
@ -630,6 +614,7 @@ class RoleController{
$rank = $_REQUEST['rank'];
$ar = $this->getRankReward($rank);
$coin_num = $ar['zbmode_param'];
$kills = $_REQUEST['kills'];
$row = $conn->execQueryOne('SELECT daily_time, coin_num, biogame_times FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
@ -668,7 +653,15 @@ class RoleController{
//刷新任务
//$quest = new classes\Quest();
//$quest->triggerQuest(QUEST_DAY_FIGHT, 1, 1, $account_id);
//刷新任务
$quest = new classes\Quest();
$quest->triggerQuest(QUEST_DAY_FIGHT, 1, 1, $account_id);
// $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);
if ($rank <= 5) {
$quest->triggerQuest(QUEST_DAY_RANK, 1, 1, $account_id);
}
echo json_encode(array(
'errcode' => 0,
'errmsg' => '',

View File

@ -153,11 +153,13 @@ class SignController{
$quest = new classes\Quest();
$quest->triggerQuest(QUEST_DAY_LOGIN, 1, 1, $account_id);
} else {
$last_sign_time = 0;
$last_sign_time = $rows[0]['sign_time'];
$flag = 0;
foreach ($rows as $row) {
if ($row['sign_id'] > $last_sign_id) {
$last_sign_time = $row['sign_time'];
if ($last_sign_time <= $row['sign_time']) {
$last_sign_time = $row['sign_time'];
}
$last_sign_id = $row['sign_id'];
}
if ($row['signable'] != 1) {