Package net.bnubot.util

Examples of net.bnubot.util.BNetInputStream.skip()


      case SID_NEWS_INFO: {
        int numEntries = is.readByte();
        // int lastLogon = is.readDWord();
        // int oldestNews = is.readDWord();
        // int newestNews = is.readDWord();;
        is.skip(12);

        for(int i = 0; i < numEntries; i++) {
          int timeStamp = is.readDWord();
          String news = is.readNTStringUTF8().trim();
          if(timeStamp == 0// MOTD
View Full Code Here


      case SID_CHATEVENT: {
        BNCSChatEventId eid = BNCSChatEventId.values()[is.readDWord()];
        int flags = is.readDWord();
        int ping = is.readDWord();
        is.skip(12);
      // is.readDWord(); // IP Address (defunct)
      // is.readDWord(); // Account number (defunct)
      // is.readDWord(); // Registration authority (defunct)
        String username = is.readNTString();
        ByteArray data = null;
View Full Code Here

        if(s.isClosed() || (System.currentTimeMillis() - startTime) > 500)
          throw new Exception("BNFTP download failed");
      }

      //Receive the file
      is.skip(2)//int headerLength = is.readWord();
      is.skip(2)//int unknown = is.readWord();
      int fileSize = is.readDWord();
      is.skip(4)//int bannersID = is.readDWord();
      is.skip(4)//int bannersFileExt = is.readDWord();
      Date fileTime = TimeFormatter.fileTime(is.readQWord());
View Full Code Here

          throw new Exception("BNFTP download failed");
      }

      //Receive the file
      is.skip(2)//int headerLength = is.readWord();
      is.skip(2)//int unknown = is.readWord();
      int fileSize = is.readDWord();
      is.skip(4)//int bannersID = is.readDWord();
      is.skip(4)//int bannersFileExt = is.readDWord();
      Date fileTime = TimeFormatter.fileTime(is.readQWord());
      fileName = is.readNTString();
View Full Code Here

      //Receive the file
      is.skip(2)//int headerLength = is.readWord();
      is.skip(2)//int unknown = is.readWord();
      int fileSize = is.readDWord();
      is.skip(4)//int bannersID = is.readDWord();
      is.skip(4)//int bannersFileExt = is.readDWord();
      Date fileTime = TimeFormatter.fileTime(is.readQWord());
      fileName = is.readNTString();

      //The rest is the data
View Full Code Here

      //Receive the file
      is.skip(2)//int headerLength = is.readWord();
      is.skip(2)//int unknown = is.readWord();
      int fileSize = is.readDWord();
      is.skip(4)//int bannersID = is.readDWord();
      is.skip(4)//int bannersFileExt = is.readDWord();
      Date fileTime = TimeFormatter.fileTime(is.readQWord());
      fileName = is.readNTString();

      //The rest is the data
      new File(path).mkdir();
View Full Code Here

      case SID_AUTH_INFO:
      case SID_STARTVERSIONING: {
        if (pr.packetId == BNCSPacketId.SID_AUTH_INFO) {
          nlsRevision = is.readDWord();
          serverToken = is.readDWord();
          is.skip(4); // int udpValue = is.readDWord();
        }
        long mpqFileTime = is.readQWord();
        String mpqFileName = is.readNTString();
        byte[] valueStr = is.readNTBytes();
View Full Code Here

  private static BNetIcon[] readIconsDotBni(File f) {
    try (BNetInputStream is = new BNetInputStream(new FileInputStream(f))) {
      Out.debug(IconsDotBniReader.class, "Reading " + f.getName());

      is.skip(4); //int headerSize = is.readDWord();
      int bniVersion = is.readWord();
      is.skip(2)// Alignment Padding (unused)
      int numIcons = is.readDWord();
      is.skip(4)//int dataOffset = is.readDWord();
View Full Code Here

    try (BNetInputStream is = new BNetInputStream(new FileInputStream(f))) {
      Out.debug(IconsDotBniReader.class, "Reading " + f.getName());

      is.skip(4); //int headerSize = is.readDWord();
      int bniVersion = is.readWord();
      is.skip(2)// Alignment Padding (unused)
      int numIcons = is.readDWord();
      is.skip(4)//int dataOffset = is.readDWord();

      if(bniVersion != 1)
        throw new Exception("Unknown BNI version");
View Full Code Here

      is.skip(4); //int headerSize = is.readDWord();
      int bniVersion = is.readWord();
      is.skip(2)// Alignment Padding (unused)
      int numIcons = is.readDWord();
      is.skip(4)//int dataOffset = is.readDWord();

      if(bniVersion != 1)
        throw new Exception("Unknown BNI version");

      Out.debug(IconsDotBniReader.class, "Reading " + numIcons + " icons in format " + bniVersion);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.