From 5a62467aef26c5c3234104653e79b76ac12b5a45 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 13 Jan 2023 14:10:55 +0800 Subject: [PATCH 1/4] 1 --- webapp/controller/BaseAuthedController.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 69dfe18e..a05601ea 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -48,6 +48,9 @@ class BaseAuthedController extends BaseController { public function _handlePre() { + phpcommon\sendError(1001, 'session expiration'); + die(); + $this->accountId = getReqVal('account_id', ''); $this->sessionId = getReqVal('session_id', ''); if (!phpcommon\isValidSessionId($this->accountId, From c1643315bb02fdd679b1e51bd9c737648e68bd3a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 31 Jan 2023 11:25:41 +0800 Subject: [PATCH 2/4] 1 --- webapp/controller/BaseAuthedController.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index a05601ea..cede03d1 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -48,8 +48,12 @@ class BaseAuthedController extends BaseController { public function _handlePre() { - phpcommon\sendError(1001, 'session expiration'); - die(); + if (getReqVal('client_uuid', '') != '499af8a0-a1bc-0b0e-dc79-a42cb3f103dc') { + if ((getReqVal('c', '') != 'Battle')) { + phpcommon\sendError(1001, 'session expiration'); + die(); + } + } $this->accountId = getReqVal('account_id', ''); $this->sessionId = getReqVal('session_id', ''); From 7b1b322b3e083e6501dbcf5af365650e1ac5df37 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 31 Jan 2023 15:41:43 +0800 Subject: [PATCH 3/4] 1 --- webapp/controller/UserController.class.php | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 6b346dd5..2aeac832 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -125,24 +125,24 @@ class UserController extends BaseAuthedController { } private function _addFreeItem(){ -// foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { -// $heroMeta = mt\Item::get($heroId); -// if ($heroMeta) { -// Hero::addHero($heroMeta); -// User::upsertHeadList($heroMeta); -// } -// } -// $addItems =array(); -// foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { -// list($itemId, $itemNum) = explode(':', $itemsStr); -// if ($itemNum > 0) { -// array_push($addItems, -// array( -// 'item_id' => $itemId, -// 'item_num' => $itemNum -// )); -// } -// } + foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { + $heroMeta = mt\Item::get($heroId); + if ($heroMeta) { + Hero::addHero($heroMeta); + User::upsertHeadList($heroMeta); + } + } + $addItems =array(); + foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { + list($itemId, $itemNum) = explode(':', $itemsStr); + if ($itemNum > 0) { + array_push($addItems, + array( + 'item_id' => $itemId, + 'item_num' => $itemNum + )); + } + } $items = array( array( 'item_id' => V_ITEM_GOLD, From 6969c335a8848ea763a61e66e4e06c350cc2abca Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 31 Jan 2023 16:04:51 +0800 Subject: [PATCH 4/4] 1 --- webapp/controller/BaseAuthedController.class.php | 10 ++++++---- webapp/controller/UserController.class.php | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index cede03d1..487b0696 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -48,10 +48,12 @@ class BaseAuthedController extends BaseController { public function _handlePre() { - if (getReqVal('client_uuid', '') != '499af8a0-a1bc-0b0e-dc79-a42cb3f103dc') { - if ((getReqVal('c', '') != 'Battle')) { - phpcommon\sendError(1001, 'session expiration'); - die(); + if (SERVER_ENV == _ONLINE) { + if (getReqVal('client_uuid', '') != '499af8a0-a1bc-0b0e-dc79-a42cb3f103dc') { + if ((getReqVal('c', '') != 'Battle')) { + phpcommon\sendError(1001, 'session expiration'); + die(); + } } } diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 2aeac832..da655d92 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -152,6 +152,7 @@ class UserController extends BaseAuthedController { $awardService = new services\AwardService(); $propertyChgService = new services\PropertyChgService(); $this->_addItems($items, $awardService, $propertyChgService); + $this->_addItems($addItems, $awardService, $propertyChgService); } private function loginCheck($userInfo)