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秒内只能发送一次' },