コード例 #1
0
 @Override
 public void run() {
   PlayerGroup registeredGroup = worldMapInstance.getRegisteredGroup();
   if (registeredGroup == null) {
     if (worldMapInstance.playersCount() == 0) {
       destroyInstance(worldMapInstance);
       return;
     }
     Iterator<Player> playerIterator = worldMapInstance.playerIterator();
     int mapId = worldMapInstance.getMapId();
     while (playerIterator.hasNext()) {
       Player player = playerIterator.next();
       if (player.isOnline() && player.getWorldId() == mapId) {
         return;
       }
     }
     destroyInstance(worldMapInstance);
   } else if (registeredGroup.size() == 0) {
     destroyInstance(worldMapInstance);
   }
 }
コード例 #2
0
 public void registerGroup(PlayerGroup group) {
   registeredGroup = group;
   register(group.getGroupId());
 }