Package net.bnubot.util

Examples of net.bnubot.util.BNetOutputStream.writeByte()


      Socket s = new Socket(cs.server, cs.port);
      BNetInputStream is = new BNetInputStream(s.getInputStream());
      BNetOutputStream os = new BNetOutputStream(s.getOutputStream());
    ) {
      //FTP
      os.writeByte(0x02);

      //File request
      os.writeWord(32 + fileName.length() + 1);
      os.writeWord(0x100);    // Protocol version
      os.writeDWord(PlatformIDs.PLATFORM_IX86)// Platform ID
View Full Code Here


    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    try (BNetOutputStream sckout = new BNetOutputStream(baos)) {
      byte raw_data[] = ((ByteArrayOutputStream)this.out).toByteArray();
      sckout.writeWord(raw_data.length + 3);
      sckout.writeByte(packetId.ordinal());
      sckout.write(raw_data);
    } catch(IOException e) {
      Out.fatalException(e);
    }
View Full Code Here

                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);
                bos.writeByte(0);
              }
              final StatString statstr = new StatString(new BNetInputStream(new ByteArrayInputStream(baos.toByteArray())));

              MCPCharacter c = new MCPCharacter(time, name, statstr);
View Full Code Here

    if(GlobalSettings.packetLog) {
      String msg = "RECV " + packetId.name();
      if(Out.isDebug()) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try (BNetOutputStream os = new BNetOutputStream(baos)) {
          os.writeByte(packetId.ordinal());
          os.writeWord(packetLength);
          os.write(data);
        }
        msg += "\n" + HexDump.hexDump(baos.toByteArray());
      }
View Full Code Here

    byte data[] = ((ByteArrayOutputStream)this.out).toByteArray();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    try (BNetOutputStream sckout = new BNetOutputStream(baos)) {
      sckout.writeWord(data.length + 3);
      sckout.writeByte(packetId.ordinal());
      sckout.write(data);
    } catch(IOException e) {
      Out.fatalException(e);
    }
View Full Code Here

      String msg = "RECV " + packetId.name();
      if(Out.isDebug()) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try (BNetOutputStream os = new BNetOutputStream(baos)) {
          os.writeWord(packetLength);
          os.writeByte(packetId.ordinal());
          os.write(data);
        }
        msg += "\n" + HexDump.hexDump(baos.toByteArray());
      }
      Out.debugAlways(getClass(), msg);
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.