back_recharge
wangyuan 2019-06-05 20:53:05 +08:00
parent 3600ce66db
commit 0619b20448
1 changed files with 10 additions and 8 deletions

View File

@ -142,9 +142,9 @@ public class ProtocolsManager implements ProtocolsAbstract {
return; return;
} }
//处理多设备重登 //处理多设备重登
if (dealRepeatLogin(session)==1){ if (dealRepeatLogin(session.getUid())==1){
MessageUtil.sendErrorCode(session,0,"您的账号已经在其他设备上登陆,请确认账号安全!"); /* MessageUtil.sendErrorCode(session,0,"您的账号已经在其他设备上登陆,请确认账号安全!");
return; return;*/
} }
//刷新token //刷新token
refreshToken(session); refreshToken(session);
@ -222,12 +222,11 @@ public class ProtocolsManager implements ProtocolsAbstract {
} }
private int dealRepeatLogin(ISession session) { private int dealRepeatLogin(int uid) {
if (OnlineUserManager.checkUidOnline(session.getUid())){ if (OnlineUserManager.checkUidOnline(uid)){
ISession iSession = OnlineUserManager.getSessionByUid(session.getUid()); ISession iSession = OnlineUserManager.getSessionByUid(uid);
MessageUtil.sendErrorCode(iSession, ErrorCode.reloginCode,"您的账号已经在其他设备上登陆,请确认账号安全!"); MessageUtil.sendErrorCode(iSession, ErrorCode.reloginCode,"您的账号已经在其他设备上登陆,请确认账号安全!");
OnlineUserManager.userOffline(iSession.getUid()); iSession.setOfflineType(ErrorCode.reloginCode);
iSession.close();
return 1; return 1;
} }
return 0; return 0;
@ -281,6 +280,9 @@ public class ProtocolsManager implements ProtocolsAbstract {
// } catch (FileNotFoundException e) { // } catch (FileNotFoundException e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
if(session.getOfflineType() == ErrorCode.reloginCode){
return;
}
if (session.getCtx() != null) { if (session.getCtx() != null) {
GameMessageHandler.allChannels.remove(session.getCtx().channel()); GameMessageHandler.allChannels.remove(session.getCtx().channel());
} }