Merge branch 'james' of git.kingsome.cn:server/game2006api into james
This commit is contained in:
commit
2c9a26a113
@ -8,6 +8,7 @@ function add(name) {
|
||||
function init() {
|
||||
add('fragment');
|
||||
add('damping');
|
||||
add('season');
|
||||
}
|
||||
|
||||
exports.init = init;
|
||||
|
32
server/game2006service/tasks/season.js
Normal file
32
server/game2006service/tasks/season.js
Normal file
@ -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;
|
@ -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()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,6 +35,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 //赛季是否空挡期
|
||||
|
Loading…
x
Reference in New Issue
Block a user