1
This commit is contained in:
parent
b139249b53
commit
01d9795ebd
@ -103,5 +103,41 @@ class FriendController{
|
|||||||
'errmsg' => '',
|
'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,
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -146,8 +146,8 @@ class RoleController{
|
|||||||
public function roleInfo()
|
public function roleInfo()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
$user_name = $_REQUEST['name'];
|
$user_name = '突击队员';
|
||||||
$avatar_url = $_REQUEST['avatar_url'];
|
$avatar_url = '1';
|
||||||
$switch_id = 1;
|
$switch_id = 1;
|
||||||
$switch_id = isset($_REQUEST['switch_id']);
|
$switch_id = isset($_REQUEST['switch_id']);
|
||||||
//登录校验
|
//登录校验
|
||||||
@ -247,28 +247,10 @@ class RoleController{
|
|||||||
'act_video_status' => 0,
|
'act_video_status' => 0,
|
||||||
'act_ad_status' => 0,
|
'act_ad_status' => 0,
|
||||||
'biogame_times' => 0,
|
'biogame_times' => 0,
|
||||||
|
'user_name' => $user_name,
|
||||||
|
'avatar_url' => $avatar_url,
|
||||||
));
|
));
|
||||||
} else {
|
} 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());
|
$nowTime = phpcommon\getdayseconds(time());
|
||||||
$daily_first_login = $row['daily_first_login'];
|
$daily_first_login = $row['daily_first_login'];
|
||||||
$coin_times = $row['coin_times'];
|
$coin_times = $row['coin_times'];
|
||||||
@ -359,6 +341,8 @@ class RoleController{
|
|||||||
'act_video_status' => $row['act_video_status'],
|
'act_video_status' => $row['act_video_status'],
|
||||||
'act_ad_status' => $act_ad_status,
|
'act_ad_status' => $act_ad_status,
|
||||||
'biogame_times' => $row['biogame_times'],
|
'biogame_times' => $row['biogame_times'],
|
||||||
|
'user_name' => $row['user_name'],
|
||||||
|
'avatar_url' => $row['avatar_url'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -630,6 +614,7 @@ class RoleController{
|
|||||||
$rank = $_REQUEST['rank'];
|
$rank = $_REQUEST['rank'];
|
||||||
$ar = $this->getRankReward($rank);
|
$ar = $this->getRankReward($rank);
|
||||||
$coin_num = $ar['zbmode_param'];
|
$coin_num = $ar['zbmode_param'];
|
||||||
|
$kills = $_REQUEST['kills'];
|
||||||
$row = $conn->execQueryOne('SELECT daily_time, coin_num, biogame_times FROM user WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne('SELECT daily_time, coin_num, biogame_times FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
@ -668,7 +653,15 @@ class RoleController{
|
|||||||
//刷新任务
|
//刷新任务
|
||||||
//$quest = new classes\Quest();
|
//$quest = new classes\Quest();
|
||||||
//$quest->triggerQuest(QUEST_DAY_FIGHT, 1, 1, $account_id);
|
//$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(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
'errmsg' => '',
|
'errmsg' => '',
|
||||||
|
@ -153,11 +153,13 @@ class SignController{
|
|||||||
$quest = new classes\Quest();
|
$quest = new classes\Quest();
|
||||||
$quest->triggerQuest(QUEST_DAY_LOGIN, 1, 1, $account_id);
|
$quest->triggerQuest(QUEST_DAY_LOGIN, 1, 1, $account_id);
|
||||||
} else {
|
} else {
|
||||||
$last_sign_time = 0;
|
$last_sign_time = $rows[0]['sign_time'];
|
||||||
$flag = 0;
|
$flag = 0;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if ($row['sign_id'] > $last_sign_id) {
|
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'];
|
$last_sign_id = $row['sign_id'];
|
||||||
}
|
}
|
||||||
if ($row['signable'] != 1) {
|
if ($row['signable'] != 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user