From e4538c7ef6926f0923de6e45c49cae76efdcd507 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 9 Jul 2024 15:12:36 +0800 Subject: [PATCH] 1 --- doc/Other.py | 5 +-- webapp/controller/BagController.class.php | 5 +-- .../controller/BaseAuthedController.class.php | 18 +++++------ webapp/services/ServerSwitch.php | 31 +++++++++++++++++++ 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/doc/Other.py b/doc/Other.py index 90ddf3bb..943df851 100644 --- a/doc/Other.py +++ b/doc/Other.py @@ -96,9 +96,10 @@ class Other(object): _common.RspHead(), ['data', [ ['heroChain',0,'英雄上链'], + ['heroUp',0,'英雄升阶'], ['goldSyn',0,'金币合成'], - ['pieceSyn',0,'碎片合成'], - ['pieceUp',0,'碎片升阶'], + ['heroPieceSyn',0,'英雄碎片合成'], + ['chipPieceSyn',0,'芯片碎片合成'], ], '开关信息'], ] }, diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 5a647b22..fc7a1fea 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -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, ); diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 82fc697d..e515ca5d 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -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) diff --git a/webapp/services/ServerSwitch.php b/webapp/services/ServerSwitch.php index 665ae7b0..7845193d 100644 --- a/webapp/services/ServerSwitch.php +++ b/webapp/services/ServerSwitch.php @@ -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(){