Package org.getspout.spoutapi.io.CRCStore

Examples of org.getspout.spoutapi.io.CRCStore.URLCheck


      }
      if (!url.toLowerCase().endsWith(".zip")) {
        throw new IllegalArgumentException("A Texture Pack must be in a .zip format");
      }
      final String finalURL = url;
      URLCheck urlCheck = new URLCheck(url, new byte[16384], new CRCStoreRunnable() {
        Long CRC;

        @Override
        public void setCRC(Long CRC) {
          this.CRC = CRC;
        }

        @Override
        public void run() {
          sendPacket(new PacketTexturePack(finalURL, CRC));
        }
      });
      urlCheck.start();
    }
  }
View Full Code Here


      LinkedList<Thread> urlThreads = new LinkedList<Thread>();
      Iterator<Entry<Plugin, List<String>>> j = preLoginUrlCache.entrySet().iterator();
      while (j.hasNext()) {
        final Entry<Plugin, List<String>> next = j.next();
        for (final String url : next.getValue()) {
          URLCheck urlCheck = new URLCheck(url, new byte[4096], new CRCStoreRunnable() {
            Long CRC;

            public void setCRC(Long CRC) {
              this.CRC = CRC;
            }

            public void run() {
              player.sendPacket(new PacketPreCacheFile(next.getKey().getDescription().getName(), url, CRC, true));
            }
          });
          urlCheck.setName(url);
          urlCheck.start();
          urlThreads.add(urlCheck);
        }
      }
      new URLCheckJoin(urlThreads, player).start();
    }
View Full Code Here

    if (!isValidUrl(fileUrl)) {
      return false;
    }

    if (addToPreLoginCache(plugin, fileUrl)) {
      URLCheck urlCheck = new URLCheck(fileUrl, new byte[4096], new CRCStoreRunnable() {
        Long CRC;

        public void setCRC(Long CRC) {
          this.CRC = CRC;
        }

        public void run() {
          for (SpoutPlayer player : SpoutManager.getOnlinePlayers()) {
            if (player.isSpoutCraftEnabled()) {
              player.sendPacket(new PacketPreCacheFile(plugin.getDescription().getName(), fileUrl, CRC, true));
            }
          }
        }
      });
      urlCheck.start();
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.io.CRCStore.URLCheck

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.