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