From 1dc2be92306113ca2cd2720a0220ff1c3ae67745 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 21 Apr 2021 17:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=9A=E6=B7=BB=E5=8A=A010?= =?UTF-8?q?03=E6=8A=A5=E9=94=99=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app.ts | 6 +++--- shared/consts/statusCode.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game-server/app.ts b/game-server/app.ts index 08803a696..0eed6ea1a 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -1,5 +1,5 @@ require('xprofiler').start(); -import { COM_TEAM_STATUS } from './app/consts'; +import { COM_TEAM_STATUS, STATUS } from './app/consts'; import { createTcpAcceptor, createTcpMailBox, @@ -23,7 +23,7 @@ import * as redLockService from './app/services/redLockService'; import _pinus = require('pinus'); import { updateTeamStatus } from './app/services/comBattleService'; import { init } from './app/pubUtils/gmData/gmDataUtil'; -import { gameData } from './app/pubUtils/data'; +import { resResult } from './app/pubUtils/util'; const filePath = (_pinus as any).FILEPATH; filePath.MASTER = '/config/master'; filePath.SERVER = '/config/servers'; @@ -149,7 +149,7 @@ function errorHandler(err: Error, msg: any, resp: any, to resolve unknown exception: sessionId:${ JSON.stringify(session.export()) } , error stack: ${ err.stack }`); if (!resp) { - resp = { code: 1003 }; + resp = resResult(STATUS.GLOBAL_ERR); } cb(err, resp); } diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index 500c835e1..312d3a137 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -7,6 +7,7 @@ export const STATUS = { CONNECTOR_ERR: { code: 4, simStr: '连接服配置错误' }, LOGIN_ERR: { code: 5, simStr: '检测到您的账号异地登录,已被迫下线' }, REDLOCK_ERR: { code: 6, simStr: 'redlock错误' }, + GLOBAL_ERR: { code: 1003, simStr: '服务器内部错误' }, // 账号相关状态 10000 - 19999 SMS_IN_60S: { code: 10001, simStr: '60秒内只能发送一次' },