From 25fc318f0284c58b4e6de88536dcf6846babb6d0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Oct 2022 22:05:29 +0800 Subject: [PATCH 1/3] 1 --- webapp/controller/GuideController.class.php | 32 +++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/webapp/controller/GuideController.class.php b/webapp/controller/GuideController.class.php index 6fbf1ab8..2ea9b723 100644 --- a/webapp/controller/GuideController.class.php +++ b/webapp/controller/GuideController.class.php @@ -6,12 +6,40 @@ class GuideController extends BaseAuthedController { public function getData() { - + $row = SqlHelper::ormSelectOne( + $this->_getSelfMysql(), + 't_guide_data', + array( + 'account_id' => $this->_getAccountId() + ) + ); + echo json_encode(array( + 'errcode' => 0, + 'errmsg' => "OK", + 'data' => $row ? $row['data'] : null + )); } public function setData() { - + $data = getReqVal('data', ''); + SqlHelper::upsert( + $this->_getSelfMysql(), + 't_guide_data', + array( + 'account_id' => $this->_getAccountId(), + ), + array( + 'data' => $data, + 'modifytime' => $this->_getNowTime(), + ), + array( + 'account_id' => $this->_getAccountId(), + 'data' => $data, + 'createtime' => $this->_getNowTime(), + 'modifytime' => $this->_getNowTime() + ) + ); } } From 9d78c8c141534e37e667092f153fabc984b81cbd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Oct 2022 22:06:03 +0800 Subject: [PATCH 2/3] 1 --- webapp/controller/RankingController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/controller/RankingController.class.php b/webapp/controller/RankingController.class.php index 71d74c9c..fbc768ac 100644 --- a/webapp/controller/RankingController.class.php +++ b/webapp/controller/RankingController.class.php @@ -31,6 +31,7 @@ class RankingController extends BaseAuthedController { $rank_status = $this->_getV(TN_RANK_STATUS, 0 ); $is_rank = $this->_getV(TN_RANK_STATUS, 1 ); + $is_rank = 0; $this->_rspData(array( 'status' => $rank_status, // 0:常规状态 1:引导初始排位 2:赛季初,需结算上个赛季 'is_rank' => $is_rank //赛季是否空挡期 From 459df7f160f475f6823da721fab44533f4db4048 Mon Sep 17 00:00:00 2001 From: lightings <17062401@qq.com> Date: Fri, 28 Oct 2022 09:49:00 +0800 Subject: [PATCH 3/3] add season.js --- server/game2006service/tasks/factory.js | 1 + server/game2006service/tasks/season.js | 32 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 server/game2006service/tasks/season.js diff --git a/server/game2006service/tasks/factory.js b/server/game2006service/tasks/factory.js index 0ff3a34b..8345ea4d 100644 --- a/server/game2006service/tasks/factory.js +++ b/server/game2006service/tasks/factory.js @@ -8,6 +8,7 @@ function add(name) { function init() { add('fragment'); add('damping'); + add('season'); } exports.init = init; diff --git a/server/game2006service/tasks/season.js b/server/game2006service/tasks/season.js new file mode 100644 index 00000000..0da9c51c --- /dev/null +++ b/server/game2006service/tasks/season.js @@ -0,0 +1,32 @@ +const app = require('j7/app'); +const utils = require('j7/utils'); +const metaFactory = require('../metadata/factory'); + +const constant = require('../constant'); + +class Season { + async start() { + while (true) { + await this.doRoutine(utils.getUtcTime()); + const nowTime = utils.getUtcTime(); + const daySeconds = utils.getDaySeconds(nowTime, constant.TIME_ZONE); + const sleepTime = daySeconds + 3600 * 24 - nowTime; + await utils.sleep(sleepTime*1000); + } + } + + async doRoutine(nowTime) { + try { + + } + catch(err) { + console.log(err); + } + } +} + +function init() { + (new Season()).start(); +} + +exports.init = init; \ No newline at end of file