public WorldLocation getLocation(String charName) throws RemoteException { for (int i : WorldRegistryImpl.getInstance().getChannelServer()) { ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i); try { if (cwi.isConnected(charName)) { return new WorldLocation(cwi.getLocation(charName), cwi.getChannelId()); } } catch (RemoteException e) { WorldRegistryImpl.getInstance().deregisterChannelServer(i); } } return null; }
public boolean isConnected(String charName) throws RemoteException { for (int i : WorldRegistryImpl.getInstance().getChannelServer()) { ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i); try { if (cwi.isConnected(charName)) { return true; } } catch (RemoteException e) { WorldRegistryImpl.getInstance().deregisterChannelServer(i); } } return false; }
// can we generify this @Override public int find(int characterId) throws RemoteException { for (int i : WorldRegistryImpl.getInstance().getChannelServer()) { ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i); try { if (cwi.isConnected(characterId)) { return cwi.getChannelId(); } } catch (RemoteException e) { WorldRegistryImpl.getInstance().deregisterChannelServer(i); } } return -1; }