From c8a826466b60ea451d00c232e328fa9b30d6c37a Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Fri, 16 Oct 2020 15:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9util=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E4=B8=BA=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=9B=E5=88=A0?= =?UTF-8?q?=E6=8E=89=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/pubUtils | 2 +- shared/db/Role.ts | 2 +- shared/db/TowerTaskRec.ts | 11 ----------- shared/pubUtils/util.ts | 3 --- web-server/app/pubUtils | 2 +- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/game-server/app/pubUtils b/game-server/app/pubUtils index a3f89e4da..831ac6847 120000 --- a/game-server/app/pubUtils +++ b/game-server/app/pubUtils @@ -1 +1 @@ -/Users/bantu/zyz_server/shared/pubUtils \ No newline at end of file +../../shared/pubUtils \ No newline at end of file diff --git a/shared/db/Role.ts b/shared/db/Role.ts index d89460f65..93ef62603 100644 --- a/shared/db/Role.ts +++ b/shared/db/Role.ts @@ -156,7 +156,7 @@ export default class Role extends BaseModel { if (cnt < 0) return null; const result = await RoleModel.findOneAndUpdate({roleId}, {$inc: {hangUpSpdUpCnt: -cnt}, lastSpdUpTime: curTime}, {new: true}).lean(lean); - const lastSpdUpTime = result?result.lastSpdUpTime: curTime; + const lastSpdUpTime = result?result.lastSpdUpTime: curTime; let role = null; if (shouldRefresh(lastSpdUpTime, curTime, HANG_UP_CONSTS.REFRESH_TIME, 1) && cnt <= HANG_UP_CONSTS.MAX_SPD_UP_CNT) { role = await RoleModel.findOneAndUpdate({roleId}, {hangUpSpdUpCnt: HANG_UP_CONSTS.MAX_SPD_UP_CNT - cnt, lastSpdUpTime: curTime}, {new: true}).lean(lean); diff --git a/shared/db/TowerTaskRec.ts b/shared/db/TowerTaskRec.ts index 47265b455..180d1417b 100644 --- a/shared/db/TowerTaskRec.ts +++ b/shared/db/TowerTaskRec.ts @@ -1,17 +1,6 @@ import BaseModel from './BaseModel'; import { index, getModelForClass, prop } from '@typegoose/typegoose'; -// class TowerTask { -// @prop({ required: true }) -// id: number; // 任务唯一 Id,来自任务表 -// @prop({ required: true}) -// taskCode: string; // 服务器生成的任务唯一编号 -// @prop({ required: true, type: Number, default: []}) -// heroes: Array; // 派遣武将 hid -// @prop({ required: true }) -// status: boolean; // 派遣任务当前状态,0-可派遣,1-已派遣,2-已完成,3-已领取 -// } - function genCodeTmp(len) { const chars = '123456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijklmnopqrstuvwxyz'; const charArr = chars.split(''); diff --git a/shared/pubUtils/util.ts b/shared/pubUtils/util.ts index 383f2e7dc..d1297f15c 100644 --- a/shared/pubUtils/util.ts +++ b/shared/pubUtils/util.ts @@ -1,9 +1,6 @@ import { getGamedata } from './gamedata'; -// import { CounterModel } from '../db/Counter'; -// import { EquipModel } from '../db/Equip'; import { HeroModel } from '../db/Hero'; -// import { GOOD_TYPE } from '../consts/consts'; const moment = require('moment'); export function genCode(len) { diff --git a/web-server/app/pubUtils b/web-server/app/pubUtils index a3f89e4da..831ac6847 120000 --- a/web-server/app/pubUtils +++ b/web-server/app/pubUtils @@ -1 +1 @@ -/Users/bantu/zyz_server/shared/pubUtils \ No newline at end of file +../../shared/pubUtils \ No newline at end of file