diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java index 4ae96f00c..a7430347b 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java @@ -445,7 +445,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri @Override public boolean isChanged() { try { - return _hallServer.hasChanges(_resourceOwner, _channelNumber); + return _hallServer.getCommunicationChannel(_resourceOwner, _channelNumber).hasChangesInCommunicationChannel(_hallServer, _resourceOwner); } catch (SubscriptionExpiredException e) { return true; } catch (SubscriptionConflictException e) { @@ -463,7 +463,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri Element hall = doc.createElement("hall"); try { - _hallServer.processHall(_resourceOwner, _channelNumber, new SerializeHallInfoVisitor(doc, hall)); + _hallServer.getCommunicationChannel(_resourceOwner, _channelNumber).processCommunicationChannel(_hallServer, _resourceOwner, new SerializeHallInfoVisitor(doc, hall)); } catch (SubscriptionExpiredException exp) { throw new HttpProcessingException(410); } catch (SubscriptionConflictException exp) { diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 014087ed2..43713a188 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -432,31 +432,13 @@ public class HallServer extends AbstractServer { } } - public boolean hasChanges(Player player, int channelNumber) throws SubscriptionExpiredException, SubscriptionConflictException { + public HallCommunicationChannel getCommunicationChannel(Player player, int channelNumber) throws SubscriptionExpiredException, SubscriptionConflictException { _hallDataAccessLock.readLock().lock(); try { HallCommunicationChannel communicationChannel = _playerChannelCommunication.get(player); if (communicationChannel != null) { if (communicationChannel.getChannelNumber() == channelNumber) { - return communicationChannel.hasChangesInCommunicationChannel(this, player); - } else { - throw new SubscriptionConflictException(); - } - } else { - throw new SubscriptionExpiredException(); - } - } finally { - _hallDataAccessLock.readLock().unlock(); - } - } - - public void processHall(Player player, int channelNumber, HallChannelVisitor hallChannelVisitor) throws SubscriptionExpiredException, SubscriptionConflictException { - _hallDataAccessLock.readLock().lock(); - try { - HallCommunicationChannel communicationChannel = _playerChannelCommunication.get(player); - if (communicationChannel != null) { - if (communicationChannel.getChannelNumber() == channelNumber) { - communicationChannel.processCommunicationChannel(this, player, hallChannelVisitor); + return communicationChannel; } else { throw new SubscriptionConflictException(); }