Giving direct access to HallCommunicationChannel.
This commit is contained in:
@@ -445,7 +445,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
|
|||||||
@Override
|
@Override
|
||||||
public boolean isChanged() {
|
public boolean isChanged() {
|
||||||
try {
|
try {
|
||||||
return _hallServer.hasChanges(_resourceOwner, _channelNumber);
|
return _hallServer.getCommunicationChannel(_resourceOwner, _channelNumber).hasChangesInCommunicationChannel(_hallServer, _resourceOwner);
|
||||||
} catch (SubscriptionExpiredException e) {
|
} catch (SubscriptionExpiredException e) {
|
||||||
return true;
|
return true;
|
||||||
} catch (SubscriptionConflictException e) {
|
} catch (SubscriptionConflictException e) {
|
||||||
@@ -463,7 +463,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
|
|||||||
|
|
||||||
Element hall = doc.createElement("hall");
|
Element hall = doc.createElement("hall");
|
||||||
try {
|
try {
|
||||||
_hallServer.processHall(_resourceOwner, _channelNumber, new SerializeHallInfoVisitor(doc, hall));
|
_hallServer.getCommunicationChannel(_resourceOwner, _channelNumber).processCommunicationChannel(_hallServer, _resourceOwner, new SerializeHallInfoVisitor(doc, hall));
|
||||||
} catch (SubscriptionExpiredException exp) {
|
} catch (SubscriptionExpiredException exp) {
|
||||||
throw new HttpProcessingException(410);
|
throw new HttpProcessingException(410);
|
||||||
} catch (SubscriptionConflictException exp) {
|
} catch (SubscriptionConflictException exp) {
|
||||||
|
|||||||
@@ -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();
|
_hallDataAccessLock.readLock().lock();
|
||||||
try {
|
try {
|
||||||
HallCommunicationChannel communicationChannel = _playerChannelCommunication.get(player);
|
HallCommunicationChannel communicationChannel = _playerChannelCommunication.get(player);
|
||||||
if (communicationChannel != null) {
|
if (communicationChannel != null) {
|
||||||
if (communicationChannel.getChannelNumber() == channelNumber) {
|
if (communicationChannel.getChannelNumber() == channelNumber) {
|
||||||
return communicationChannel.hasChangesInCommunicationChannel(this, player);
|
return communicationChannel;
|
||||||
} 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);
|
|
||||||
} else {
|
} else {
|
||||||
throw new SubscriptionConflictException();
|
throw new SubscriptionConflictException();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user