1
This commit is contained in:
parent
e4161eb030
commit
fa7b11b0d9
@ -9,6 +9,7 @@ define('LAST_SESSION_KEY', 'last_session:');
|
||||
define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:');
|
||||
define('MATCH_OK_KEY', 'match:ok:');
|
||||
define('DEC_BATTLE_TICKET', 'battle_ticket:');
|
||||
define('LAST_ACTIVE_TIME', 'last_active_time:');
|
||||
|
||||
define('V_ITEM_GOLD', 10001); //金币
|
||||
define('V_ITEM_GOLDS', 10017); //金堆
|
||||
|
@ -96,11 +96,11 @@ class BaseAuthedController extends BaseController {
|
||||
die();
|
||||
}
|
||||
}
|
||||
$r = $this->_getRedis($this->_getAccountId());
|
||||
if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) {
|
||||
if ((getReqVal('c', '') == 'Battle')) {
|
||||
return;
|
||||
}
|
||||
$r = $this->_getRedis($this->_getAccountId());
|
||||
$sessionId = $r->get(LAST_SESSION_KEY . $this->_getAccountId());
|
||||
// error_log('SERVER_ENV:' . SERVER_ENV . '_DEBUG:' . _DEBUG);
|
||||
if (SERVER_ENV != _DEBUG)
|
||||
@ -116,9 +116,8 @@ class BaseAuthedController extends BaseController {
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->updateActive($r);
|
||||
/*if (SERVER_ENV == _ONLINE) {
|
||||
if (phpcommon\cmpVersion(getReqVal('_version', ''), '0.2.0') > 0) {
|
||||
if (!$this->isWhiteList() || myself()->_getChannel() != BC_CHANNEL) {
|
||||
@ -129,7 +128,15 @@ class BaseAuthedController extends BaseController {
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
protected function updateActive($r)
|
||||
{
|
||||
$lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId());
|
||||
//第一次登录或者跨天更新最后活跃时间
|
||||
if (empty($lastActiveTime) ||
|
||||
$lastActiveTime < $this->_getNowDaySeconds()) {
|
||||
$r->setNxPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
|
||||
}
|
||||
}
|
||||
|
||||
protected function updateSession($accountId, $sessionId)
|
||||
{
|
||||
|
@ -66,21 +66,26 @@ class OutAppNftController extends BaseController {
|
||||
)
|
||||
);
|
||||
$accountId = $accountBindDb ? $accountBindDb['cur_account_id'] : $accountId ;
|
||||
$loginDyn = SqlHelper::ormSelectOne(
|
||||
myself()->_getMysql($openId),
|
||||
't_dyndata',
|
||||
array(
|
||||
'account_id' => $accountId,
|
||||
'x' => TN_DAILY_LOGINS,
|
||||
'y' => 0,
|
||||
)
|
||||
);
|
||||
if ($loginDyn){
|
||||
$info['loginVal'] = $loginDyn['val'];
|
||||
if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) {
|
||||
$info['loginVal'] = 0;
|
||||
}
|
||||
$redis = $this->_getRedis($accountId);
|
||||
$lastActiveTime = $redis->get(LAST_ACTIVE_TIME . $accountId);
|
||||
if (!empty($lastActiveTime) && $lastActiveTime > myself()->_getNowDaySeconds()){
|
||||
$info['loginVal'] = 1;
|
||||
}
|
||||
// $loginDyn = SqlHelper::ormSelectOne(
|
||||
// myself()->_getMysql($openId),
|
||||
// 't_dyndata',
|
||||
// array(
|
||||
// 'account_id' => $accountId,
|
||||
// 'x' => TN_DAILY_LOGINS,
|
||||
// 'y' => 0,
|
||||
// )
|
||||
// );
|
||||
// if ($loginDyn){
|
||||
// $info['loginVal'] = $loginDyn['val'];
|
||||
// if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) {
|
||||
// $info['loginVal'] = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
$battleDb = SqlHelper::ormSelectOne(
|
||||
myself()->_getMysql($openId),
|
||||
|
Loading…
x
Reference in New Issue
Block a user