线上账号登录异常
parent
2cfe662de8
commit
8740994520
|
@ -105,6 +105,9 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
|
|||
public <T> T findById(String collectionName, String id, Class<T> clazz) throws Exception {
|
||||
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(Integer.parseInt(id), GameApplication.serverId);
|
||||
MongoTemplate otherMonogTemplate = getMongoTemplate(serverIdByUid);
|
||||
if(otherMonogTemplate==null){
|
||||
return null;
|
||||
}
|
||||
return otherMonogTemplate.findById(id,clazz,collectionName);
|
||||
}
|
||||
|
||||
|
@ -112,6 +115,9 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
|
|||
public <T> T findById(String collectionName, int id, Class<T> clazz) throws Exception {
|
||||
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(id, GameApplication.serverId);
|
||||
MongoTemplate otherMonogTemplate = getMongoTemplate(serverIdByUid);
|
||||
if(otherMonogTemplate==null){
|
||||
return null;
|
||||
}
|
||||
return otherMonogTemplate.findById(id,clazz,collectionName);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,8 @@ public class StoreLogic implements IEventHandler {
|
|||
if(session.getFiveReady() == 1){
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
if(user==null){
|
||||
OnlineUserManager.sessionMap.remove(session.getUid());
|
||||
LOGGER.info("user null removeid=>{}",session.getUid());
|
||||
OnlineUserManager.userOffline(session.getUid());
|
||||
continue;
|
||||
}
|
||||
long userCreateTime = user.getPlayerInfoManager().getCreateTime();
|
||||
|
@ -109,7 +110,8 @@ public class StoreLogic implements IEventHandler {
|
|||
if(session.getFiveReady() == 1){
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
if(user==null){
|
||||
OnlineUserManager.sessionMap.remove(session.getUid());
|
||||
LOGGER.info("user null removeid=>{}",session.getUid());
|
||||
OnlineUserManager.userOffline(session.getUid());
|
||||
continue;
|
||||
}
|
||||
if(!user.getStoreManager().getStoreInfoMap().containsKey(sStoreTypeConfig.getId())){
|
||||
|
|
|
@ -37,6 +37,8 @@ public class RetrySendIndicationThread extends Thread{
|
|||
Map<Integer, ISession> sessionMap = new ConcurrentHashMap<>(OnlineUserManager.sessionMap);
|
||||
long now = TimeUtils.now();
|
||||
Set<Integer> removeIds = new HashSet<>();
|
||||
|
||||
|
||||
for(ISession session : sessionMap.values()){
|
||||
if(session == null){
|
||||
continue;
|
||||
|
@ -65,7 +67,18 @@ public class RetrySendIndicationThread extends Thread{
|
|||
}
|
||||
}
|
||||
for(Integer removeId:removeIds ){
|
||||
OnlineUserManager.sessionMap.remove(removeId);
|
||||
LOGGER.info("close channel removeid=>{}",removeId);
|
||||
OnlineUserManager.userOffline(removeId);
|
||||
}
|
||||
|
||||
for(Map.Entry<Integer,ISession> sessionEntry:sessionMap.entrySet()){
|
||||
if(sessionEntry.getValue() == null){
|
||||
continue;
|
||||
}
|
||||
if(sessionEntry.getValue().getUid()!=sessionEntry.getKey()){
|
||||
LOGGER.error("Exception: map key value 不一致key{},sessionUid{}",sessionEntry.getKey(),sessionEntry.getValue().getUid());
|
||||
OnlineUserManager.userOffline(sessionEntry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue