diff --git a/server/game2006service/tasks/factory.js b/server/game2006service/tasks/factory.js index adf60be2..65dc0b4b 100644 --- a/server/game2006service/tasks/factory.js +++ b/server/game2006service/tasks/factory.js @@ -1,5 +1,12 @@ -function init() { +const tasks = {}; +function add(name) { + tasks[name] = require(`./${name}`); + tasks[name].init(); +} + +function init() { + add('fragment'); } exports.init = init; diff --git a/server/game2006service/tasks/fragment.js b/server/game2006service/tasks/fragment.js index d9c16592..5284aeb7 100644 --- a/server/game2006service/tasks/fragment.js +++ b/server/game2006service/tasks/fragment.js @@ -1,5 +1,25 @@ +const app = require('j7/app'); +const utils = require('j7/utils'); + +const YESTERDAY_HERO_NUM = 1000; +const YESTERDAY_GUN_NUM = 1000; + class Fragment { + async start() { + while (true) { + const nowTime = utils.getUtcTime(); + } + } + + async alloc() { + + } + } -module.exports = Fragment; +function init() { + (new Fragment()).start(); +} + +exports.init = init; diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 52fe301a..0840343e 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -611,7 +611,8 @@ CREATE TABLE `t_fragment_pool` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `fragment_id` int(11) NOT NULL DEFAULT '0' COMMENT '碎片id', `fragment_type` int(11) NOT NULL DEFAULT '0' COMMENT '碎片类型 0:英雄 1:武器', - `fragment_num` int(11) NOT NULL DEFAULT '0' COMMENT '碎片数量', + `fragment_num` int(11) NOT NULL DEFAULT '0' COMMENT '剩余碎片数量', + `alloc_num` int(11) NOT NULL DEFAULT '0' COMMENT '分配的碎片数量', `alloc_time` int(11) NOT NULL DEFAULT '0' COMMENT '分配时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/third_party/j7 b/third_party/j7 index 60793c7b..6a6a58c9 160000 --- a/third_party/j7 +++ b/third_party/j7 @@ -1 +1 @@ -Subproject commit 60793c7b53c719d4b50482a88d25b2b18aa51069 +Subproject commit 6a6a58c94497cc008ca467942f99576e1385d9ad