This commit is contained in:
hujiabin 2024-07-09 15:12:36 +08:00
parent 8b7b7859d2
commit e4538c7ef6
4 changed files with 46 additions and 13 deletions

View File

@ -96,9 +96,10 @@ class Other(object):
_common.RspHead(),
['data', [
['heroChain',0,'英雄上链'],
['heroUp',0,'英雄升阶'],
['goldSyn',0,'金币合成'],
['pieceSyn',0,'碎片合成'],
['pieceUp',0,'碎片升阶'],
['heroPieceSyn',0,'英雄碎片合成'],
['chipPieceSyn',0,'芯片碎片合成'],
], '开关信息'],
]
},

View File

@ -447,9 +447,10 @@ class BagController extends BaseAuthedController {
'ID' => 'Box',
'SUB_ID' => 'open',
'SUB_KEY' => 'open_box',
'boxInfo' => array(
'cost_info' => array(
'item_id' => $itemMeta['id'],
'item_num' => $itemNum
'item_num' => $itemNum,
'cost_gold' => $costItems
),
'result' => $hashItems,
);

View File

@ -111,11 +111,11 @@ class BaseAuthedController extends BaseController {
}
}
}
// if (!(myself()->_getChannel() == IMTBL_CHANNEL ||
// myself()->_getChannel() == GUEST_CHANNEL)) {
// phpcommon\sendError(1001, 'session expiration');
// die();
// }
if (!(myself()->_getChannel() == IMTBL_CHANNEL ||
myself()->_getChannel() == GUEST_CHANNEL)) {
phpcommon\sendError(1001, 'session expiration');
die();
}
$r = $this->_getRedis($this->_getAccountId());
if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) {
if ((getReqVal('c', '') == 'Battle')) {
@ -152,10 +152,10 @@ class BaseAuthedController extends BaseController {
{
$lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId());
//第一次登录或者跨天更新最后活跃时间
// if (empty($lastActiveTime) ||
// $lastActiveTime < $this->_getNowDaySeconds()) {
// $r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
// }
if (empty($lastActiveTime) ||
$lastActiveTime < $this->_getNowDaySeconds()) {
$r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
}
}
protected function updateSession($accountId, $sessionId)

View File

@ -9,6 +9,37 @@ class ServerSwitch {
return $this->switchConfig;
}
public function heroChainIsOpen(){
if ($this->getConfig()['heroChain'] > 0){
return true;
}
return false;
}
public function heroUpIsOpen(){
if ($this->getConfig()['heroUp'] > 0){
return true;
}
return false;
}
public function goldSynIsOpen(){
if ($this->getConfig()['goldSyn'] > 0){
return true;
}
return false;
}
public function heroPieceSynIsOpen(){
if ($this->getConfig()['heroPieceSyn'] > 0){
return true;
}
return false;
}
public function chipPieceSynIsOpen(){
if ($this->getConfig()['chipPieceSyn'] > 0){
return true;
}
return false;
}
private $switchConfig = null;
private function initConfig(){