Package net.bnubot.util

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


             * 0x00: Success
             * 0x46: Player not found
             * 0x7A: Logon failed
             * 0x7B: Character expired
             */
            int result = is.readDWord();
            switch(result) {
            case 0x00:
              recieveRealmInfo("Character logon success");
              break;
            case 0x46:
View Full Code Here


      loginPacket.sendPacket(bnlsOutputStream);
    }

    // Recieve BNLS_AUTHORIZE
    BNetInputStream is = readPacket(BNLSPacketId.BNLS_AUTHORIZE);
    int serverCode = is.readDWord();

    // Calculate checksum
    int checksum = (int) (org.jbls.BNLSProtocol.BNLSlist.BNLSChecksum(
        "bot", serverCode) & 0xFFFFFFFF);
View Full Code Here

      loginPacket.sendPacket(bnlsOutputStream);
    }

    // Recieve BNLS_AUTHORIZEPROOF
    is = readPacket(BNLSPacketId.BNLS_AUTHORIZEPROOF);
    int statusCode = is.readDWord();
    if (statusCode != 0)
      Out.error(getClass(), "Login to BNLS failed; logged in anonymously");
  }

  public int getVerByte(ProductIDs product) throws IOException {
View Full Code Here

      vbPacket.sendPacket(bnlsOutputStream);
      vbPacket.close();
    }

    BNetInputStream vbInputStream = readPacket(BNLSPacketId.BNLS_REQUESTVERSIONBYTE);
    int vbProduct = vbInputStream.readDWord();
    if (vbProduct == 0)
      throw new IOException("BNLS_REQUESTVERSIONBYTE failed.");
    if(vbProduct != product.getBnls())
      throw new IOException("BNLS_REQUESTVERSIONBYTE returned the wrong product [0x" + Integer.toHexString(vbProduct) + "]");
    return vbInputStream.readWord();
View Full Code Here

        eventHandlers.clear();
        eventHandlers.addAll(master.getEventHandlers());

        switch(pr.packetId) {
        case PACKET_BOTNETVERSION: {
          serverRevision = is.readDWord();
          Out.debug(getClass(), "BotNet server version is " + serverRevision);
          sendBotNetVersion(1, 1);
          break;
        }
        case PACKET_LOGON: {
View Full Code Here

          Out.debug(getClass(), "BotNet server version is " + serverRevision);
          sendBotNetVersion(1, 1);
          break;
        }
        case PACKET_LOGON: {
          int result = is.readDWord();
          switch(result) {
          case 0:
            dispatchRecieveError("Logon failed!");
            disconnect(ConnectionState.LONG_PAUSE_BEFORE_CONNECT);
            return false;
View Full Code Here

          }
          break;
        }
        case PACKET_CHANGEDBPASSWORD: {
          // Server is acknowledging the communication version
          communicationRevision = is.readDWord();
          Out.debug(getClass(), "BotNet communication version is " + communicationRevision);
          if(loggedon)
            return true;
          break;
        }
View Full Code Here

      BNLSPacketReader bpr = new BNLSPacketReader(bnlsInputStream);
      if(bpr.packetId != BNLSPacketId.BNLS_VERSIONCHECKEX2)
        throw new IOException("Recieved the wrong packet (" + bpr.packetId.name() + ", but expected BNLS_VERSIONCHECKEX2)");
      BNetInputStream bnlsIn = bpr.getInputStream();
      int success = bnlsIn.readDWord();
      if (success != 1) {
        Out.error(getClass(), "BNLS_VERSIONCHECKEX2 Failed\n"
            + HexDump.hexDump(bpr.getData()));
        setBNLSConnected(false);
        return null;
View Full Code Here

        setBNLSConnected(false);
        return null;
      }

      VersionCheckResult vcr = new VersionCheckResult();
      vcr.exeVersion = bnlsIn.readDWord();
      vcr.exeHash = bnlsIn.readDWord();
      vcr.exeInfo = bnlsIn.readNTBytes();
      bnlsIn.readDWord(); // cookie
      bnlsIn.readDWord(); // verbyte
      assert (bnlsIn.available() == 0);
View Full Code Here

        case PACKET_IDLE: {
          sendIdle();
          break;
        }
        case PACKET_STATSUPDATE: {
          int result = is.readDWord();
          switch(result) {
          case 0:
            dispatchRecieveError("Status update failed");
            break;
          case 1:
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.