登录:多地登陆拦截

This commit is contained in:
luying
2022-06-13 09:53:21 +08:00
parent 962932adca
commit f7dcf1b130
2 changed files with 3 additions and 6 deletions

View File

@@ -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); // 保存在线用户