コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 // 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;
 }