From f7dcf1b1306cf26e4ce1e6dfe483396a24eccf6e Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 13 Jun 2022 09:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=EF=BC=9A=E5=A4=9A=E5=9C=B0?= =?UTF-8?q?=E7=99=BB=E9=99=86=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/connector/handler/entryHandler.ts | 8 ++------ shared/consts/statusCode.ts | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/game-server/app/servers/connector/handler/entryHandler.ts b/game-server/app/servers/connector/handler/entryHandler.ts index cb72907b4..f1bfb8ab0 100644 --- a/game-server/app/servers/connector/handler/entryHandler.ts +++ b/game-server/app/servers/connector/handler/entryHandler.ts @@ -55,12 +55,8 @@ export class EntryHandler { let connect = await getRoleOnlineInfo(role.roleId); - if (connect.isOnline) { // 多地登陆踢下线 - if (connect.sid = self.app.getServerId()) { - await kickUser(self.app, role.roleId); - } else { - await self.app.rpc.connector.connectorRemote.remoteLogin.toServer(connect.sid, role.roleId); - } + if (connect.isOnline) { // 多地登陆拦截 + return resResult(STATUS.LOGIN_DUPLICATE); } let serverName = this.app.getServerId(); await roleLogin(role.roleId, user.userCode, serverName, user.pkgName, role.createTime, role.serverId); // 保存在线用户 diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index ecc0526c6..c5d50cb0e 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -15,6 +15,7 @@ export const STATUS = { ACCESS_BUSY: { code: 12, simStr: '您不久前发送过消息了,请稍等一下' }, ONLINE_USER_MAX: { code: 13, simStr: '服务器繁忙,请稍后再试' }, FUNCTION_CLOSE: { code: 14, simStr: '抱歉,该功能暂时关闭' }, + LOGIN_DUPLICATE: { code: 15, simStr: '您的账号在其他设备上已登录' }, GLOBAL_ERR: { code: 1003, simStr: '服务器内部错误' }, UPDATE_INFO_ERR: {code: 1004, simStr: '热更新配置错误'}, // http请求