Package net.bnubot.util

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


         * (BYTE) Status
         * (STRING) Location
         */
        String username = is.readNTString();
        byte rank = is.readByte();
        byte status = is.readByte();
        String location = is.readNTStringUTF8();

        dispatchClanMemberStatusChange(new ClanMember(username, rank, status, location));
        break;
      }
View Full Code Here


        /*
         * (BYTE) Old rank
         * (BYTE) New rank
         * (STRING) Clan member who changed your rank
         */
        byte oldRank = is.readByte();
        byte newRank = is.readByte();
        String user = is.readNTString();
        dispatchRecieveInfo("Rank changed from " + ClanRankIDs.ClanRank[oldRank] + " to " + ClanRankIDs.ClanRank[newRank] + " by " + user);
        dispatchClanMemberRankChange(oldRank, newRank, user);
        break;
View Full Code Here

         * (BYTE) Old rank
         * (BYTE) New rank
         * (STRING) Clan member who changed your rank
         */
        byte oldRank = is.readByte();
        byte newRank = is.readByte();
        String user = is.readNTString();
        dispatchRecieveInfo("Rank changed from " + ClanRankIDs.ClanRank[oldRank] + " to " + ClanRankIDs.ClanRank[newRank] + " by " + user);
        dispatchClanMemberRankChange(oldRank, newRank, user);
        break;
      }
View Full Code Here

      //The rest is the data
      new File(path).mkdir();
      f = new File(path + fileName);
      FileOutputStream fw = new FileOutputStream(f);
      for(int i = 0; i < fileSize; i++) {
        int b = is.readByte();
        b = b & 0xFF;
        fw.write(b);
      }
      fw.close();
View Full Code Here

              final String name = is.readNTString();

              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              byte[] data = new byte[33];
              is.read(data);
              if(is.readByte() != 0)
                throw new Exception("invalid statstr format\n" + HexDump.hexDump(baos.toByteArray()));

              try (BNetOutputStream bos = new BNetOutputStream(baos)) {
                bos.write(("PX2D[Realm]," + name + ",").getBytes());
                bos.write(data);
View Full Code Here

        icons[i] = icon;
        Out.debug(IconsDotBniReader.class, icon.toString());
      }

      //Image in targa format
      byte infoLength = is.readByte();
      is.skip(1);              // ColorMapType
      byte imageType = is.readByte();    // run-length true-color image types = 0x0A
      is.skip(5);              // ColorMapSpecification - color map data
      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
View Full Code Here

        }

        case PACKET_COMMAND: {
          // PROTOCOL VIOLATION!
          int err = is.readDWord();
          byte id = is.readByte();
          int lenOffending = is.readWord();
          int lenUnprocessed = is.readWord();
          dispatchRecieveError("Protocol violation: err=" + err + ", packet=" + BotNetPacketId.values()[id].name() + ", offending packet len=" + lenOffending + ", unprocessed data len=" + lenUnprocessed);
          disconnect(ConnectionState.LONG_PAUSE_BEFORE_CONNECT);
          break;
View Full Code Here

      }

      //Image in targa format
      byte infoLength = is.readByte();
      is.skip(1);              // ColorMapType
      byte imageType = is.readByte();    // run-length true-color image types = 0x0A
      is.skip(5);              // ColorMapSpecification - color map data
      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
      int width = is.readWord();
      int height = is.readWord();
View Full Code Here

      is.skip(5);              // ColorMapSpecification - color map data
      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
      int width = is.readWord();
      int height = is.readWord();
      byte depth = is.readByte();      // 24 bit depth is good
      /*byte descriptor =*/ is.readByte()// bits 5 and 4 (00110000) specify the corner to start coloring pixels - 00=bl, 01=br, 10=tl, 11=tr
      is.skip(infoLength)//String info = is.readFixedLengthString(infoLength);

      if(imageType != 0x0A)
        throw new Exception("Unknown image type");
View Full Code Here

      is.skip(2)//int xOrigin = is.readWord();
      is.skip(2)//int yOrigin = is.readWord();
      int width = is.readWord();
      int height = is.readWord();
      byte depth = is.readByte();      // 24 bit depth is good
      /*byte descriptor =*/ is.readByte()// bits 5 and 4 (00110000) specify the corner to start coloring pixels - 00=bl, 01=br, 10=tl, 11=tr
      is.skip(infoLength)//String info = is.readFixedLengthString(infoLength);

      if(imageType != 0x0A)
        throw new Exception("Unknown image type");
      if(depth != 24)
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.