From 3201084f1a26ba02a7467b7594d021220f18e54c Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 3 Feb 2021 10:11:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=86node=E5=8A=A0=E5=85=A5package.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index fe8e677..757958b 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "express-rate-limit": "^5.2.3", "fs-jetpack": "^4.1.0", "mongoose": "5.10.3", + "node": "^14.15.1", "redis": "^2.8.0" } } From 5ba317d3127b4d8cd033f3d80ef4d5e256357b31 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 3 Feb 2021 10:12:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 20 ++++-- src/common/GConfig.ts | 2 + src/constants/BaseConst.ts | 140 ++++++++++++++++++------------------- 3 files changed, 86 insertions(+), 76 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e60556..df96bfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -850,8 +850,7 @@ "double-ended-queue": { "version": "2.1.0-0", "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", - "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=", - "optional": true + "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" }, "dynamic-dedupe": { "version": "0.3.0", @@ -1811,11 +1810,24 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, + "node": { + "version": "14.15.1", + "resolved": "https://registry.npmjs.org/node/-/node-14.15.1.tgz", + "integrity": "sha512-BeTf2muiTEC7o3w0sUJ83GHORQ+FLNZCouQUM3VJk3LKf1keQ6ldghELrOo6nBUNZBBS5I++pgDSYPhHWcpp8w==", + "requires": { + "node-bin-setup": "^1.0.0" + } + }, "node-adm": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/node-adm/-/node-adm-0.9.1.tgz", "integrity": "sha1-+ManL/rbGn39ZjcQLJUKmpSW6EI=" }, + "node-bin-setup": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", + "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" + }, "node-forge": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", @@ -2140,7 +2152,6 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==", - "optional": true, "requires": { "double-ended-queue": "^2.1.0-0", "redis-commands": "^1.2.0", @@ -2160,8 +2171,7 @@ "redis-parser": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz", - "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=", - "optional": true + "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=" }, "regexp-clone": { "version": "1.0.0", diff --git a/src/common/GConfig.ts b/src/common/GConfig.ts index 3aa3b64..03d4407 100644 --- a/src/common/GConfig.ts +++ b/src/common/GConfig.ts @@ -12,6 +12,7 @@ import { DropItemCfg } from '../cfg/parsers/DropItemCfg' import { ItemCardCfg } from '../cfg/parsers/ItemCardCfg' import { MatchCfg } from '../cfg/parsers/MatchCfg' import { ItemFuncCfg } from '../cfg/parsers/ItemFuncCfg' +import { IncomeCfg } from '../cfg/parsers/IncomeCfg' export function initData() { @@ -27,6 +28,7 @@ export function initData() { rP(BaseConst.ITEMCARD, ItemCardCfg); rP(BaseConst.MATCH, MatchCfg); rP(BaseConst.ITEMFUNC, ItemFuncCfg); + rP(BaseConst.INCOME, IncomeCfg); DataParser.loadAll(); let map = global.$cfg.get(BaseConst.SKILL); diff --git a/src/constants/BaseConst.ts b/src/constants/BaseConst.ts index c7f3042..6e811d7 100644 --- a/src/constants/BaseConst.ts +++ b/src/constants/BaseConst.ts @@ -1,75 +1,73 @@ export class BaseConst { - // 初始手牌数量 - public static readonly INIT_CARD_NUM = 99001; - // 可更换的初始手牌上限 - public static readonly CARD_CHANGE_NUM = 99002; - // 更换初始手牌时限 - public static readonly CARD_CHANGE_TIME = 99003; - // 每回合发牌数量 - public static readonly ROUND_DRAW_NUM = 99004; - // 每满几论决斗一次 - public static readonly DUEL_ROUND_NUM = 99005; - // 第几次决斗后游戏结束 - public static readonly MAX_DUEL_NUM = 99006; - // 玩家手牌数量上限 - public static readonly MAX_CARD_NUM = 99007; - // 出牌公共时限 - public static readonly MAX_DISCARD_TIME = 99008; - // 吃牌公共时限 - public static readonly MAX_EAT_TIME = 99009; - // 操作公共时限 - public static readonly PLAYER_ACT_TIME = 99010; - // 玩家灵活时限 - public static readonly MAX_EXT_TIME = 99011; - // 每回合增加玩家灵活时限数值 - public static readonly ROUND_EXT_TIME = 99012; - // 玩家随从上限 - public static readonly MAX_PLAYER_PET_COUNT = 99013; - // 结算时间 - public static readonly ROUND_SHOW_TIME = 99014; - // 基本奖励分 - public static readonly BASE_ADD_SCORE = 99015; - // 额外奖励分 - public static readonly EXTRA_ADD_SCORE = 99016; - // 游戏结果显示时间, 也是游戏重开等待时间 - public static readonly GAME_RESULT_TIME = 99017; - // 匹配等待时间, 时间结束后, 填充机器人; - public static readonly WAITING_PLAYER_TIME = 99018; - // 匹配等待时, 每进入一个玩家, 等待时间延长n秒 - public static readonly WAITING_PLAYER_ONEPLUS = 99019; - // 英雄选择时间 - public static readonly PICK_HERO_TIME = 99020; - // 机器人操作最小时间 - public static readonly ROBOT_ACTTIME_MIN = 99021; - // 机器人操作最大时间 - public static readonly ROBOT_ACTTIME_MAX = 99022; - // 队友死亡后,补牌数量 - public static readonly TEAM_DEAD_ADDNUM = 99023 - // 胡牌张数(自摸) - public static readonly SELF_EAT_COUNT = 99024 - // 胡牌张数(吃牌) - public static readonly OTHER_EAT_COUNT = 99025 - // 轮空轮的间隔时间 - public static readonly EMPTY_ROUND_TIME = 99026 - // 各玩家初始卡牌数 - public static readonly PLAYER1_INIT_NUM = 99027 - public static readonly PLAYER2_INIT_NUM = 99028 - public static readonly PLAYER3_INIT_NUM = 99029 - public static readonly PLAYER4_INIT_NUM = 99030 + // 初始手牌数量 + public static readonly INIT_CARD_NUM = 99001 + // 可更换的初始手牌上限 + public static readonly CARD_CHANGE_NUM = 99002 + // 更换初始手牌时限 + public static readonly CARD_CHANGE_TIME = 99003 + // 每回合发牌数量 + public static readonly ROUND_DRAW_NUM = 99004 + // 每满几论决斗一次 + public static readonly DUEL_ROUND_NUM = 99005 + // 第几次决斗后游戏结束 + public static readonly MAX_DUEL_NUM = 99006 + // 玩家手牌数量上限 + public static readonly MAX_CARD_NUM = 99007 + // 出牌公共时限 + public static readonly MAX_DISCARD_TIME = 99008 + // 吃牌公共时限 + public static readonly MAX_EAT_TIME = 99009 + // 操作公共时限 + public static readonly PLAYER_ACT_TIME = 99010 + // 玩家灵活时限 + public static readonly MAX_EXT_TIME = 99011 + // 每回合增加玩家灵活时限数值 + public static readonly ROUND_EXT_TIME = 99012 + // 玩家随从上限 + public static readonly MAX_PLAYER_PET_COUNT = 99013 + // 结算时间 + public static readonly ROUND_SHOW_TIME = 99014 + // 基本奖励分 + public static readonly BASE_ADD_SCORE = 99015 + // 额外奖励分 + public static readonly EXTRA_ADD_SCORE = 99016 + // 游戏结果显示时间, 也是游戏重开等待时间 + public static readonly GAME_RESULT_TIME = 99017 + // 匹配等待时间, 时间结束后, 填充机器人; + public static readonly WAITING_PLAYER_TIME = 99018 + // 匹配等待时, 每进入一个玩家, 等待时间延长n秒 + public static readonly WAITING_PLAYER_ONEPLUS = 99019 + // 英雄选择时间 + public static readonly PICK_HERO_TIME = 99020 + // 机器人操作最小时间 + public static readonly ROBOT_ACTTIME_MIN = 99021 + // 机器人操作最大时间 + public static readonly ROBOT_ACTTIME_MAX = 99022 + // 队友死亡后,补牌数量 + public static readonly TEAM_DEAD_ADDNUM = 99023 + // 胡牌张数(自摸) + public static readonly SELF_EAT_COUNT = 99024 + // 胡牌张数(吃牌) + public static readonly OTHER_EAT_COUNT = 99025 + // 轮空轮的间隔时间 + public static readonly EMPTY_ROUND_TIME = 99026 + // 各玩家初始卡牌数 + public static readonly PLAYER1_INIT_NUM = 99027 + public static readonly PLAYER2_INIT_NUM = 99028 + public static readonly PLAYER3_INIT_NUM = 99029 + public static readonly PLAYER4_INIT_NUM = 99030 - - - - public static readonly COMPOUND = "compound"; - public static readonly EFFECTCARD = "effectcard"; - public static readonly HERO = "hero"; - public static readonly SKILL = "skill"; - public static readonly SYSTEMCARD = "systemcard"; - public static readonly UNIT = "unit"; - public static readonly FORMULA = "formula" - public static readonly DROPITEM = "dropitem"; - public static readonly ITEMCARD = "itemcard"; - public static readonly MATCH = "match"; - public static readonly ITEMFUNC = "itemfunc" + public static readonly COMPOUND = 'compound' + public static readonly EFFECTCARD = 'effectcard' + public static readonly HERO = 'hero' + public static readonly SKILL = 'skill' + public static readonly SYSTEMCARD = 'systemcard' + public static readonly UNIT = 'unit' + public static readonly FORMULA = 'formula' + public static readonly DROPITEM = 'dropitem' + public static readonly ITEMCARD = 'itemcard' + public static readonly MATCH = 'match' + public static readonly ITEMFUNC = 'itemfunc' + public static readonly INCOME = 'income' }