コード例 #1
0
 public boolean isCharacterListConnected(List<String> charName) throws RemoteException {
   for (int j = 0; j < ServerConstants.NUM_WORLDS; j++) { // NUM_WORLDS
     for (int i : WorldRegistryImpl.getInstance().getChannelServer(j)) {
       final ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i, j);
       try {
         if (cwi.isCharacterListConnected(charName)) {
           return true;
         }
       } catch (RemoteException e) {
         WorldRegistryImpl.getInstance().deregisterChannelServer(i, j);
       }
     }
   }
   return false;
 }
コード例 #2
0
 // Back to channel
 public void channelChange(CharacterTransfer data, int characterid, int toChannel)
     throws RemoteException {
   for (int j = 0; j < ServerConstants.NUM_WORLDS; j++) { // NUM_WORLDS
     for (int i : WorldRegistryImpl.getInstance().getChannelServer(j)) {
       if (i == toChannel) {
         final ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i, j);
         try {
           cwi.channelChange(data, characterid);
         } catch (RemoteException e) {
           WorldRegistryImpl.getInstance().deregisterChannelServer(i, j);
         }
       }
     }
   }
 }
コード例 #3
0
 public final String getChannelIP(int channel) throws RemoteException {
   for (int j = 0; j < ServerConstants.NUM_WORLDS; j++) { // NUM_WORLDS
     for (int i : WorldRegistryImpl.getInstance().getChannelServer(j)) {
       if (channel == i) {
         final ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i, j);
         try {
           return cwi.getIP();
         } catch (RemoteException e) {
           // WorldRegistryImpl.getInstance().deregisterChannelServer(i);
         }
       }
     }
   }
   return null;
 }