Package org.moparscape.msc.gs.connection

Examples of org.moparscape.msc.gs.connection.RSCPacket


  /**
   * Sends updates for game objects to the given player
   */
  private void updateGameObjects(Player p) {
    gameObjectPositionBuilder.setPlayer(p);
    RSCPacket temp = gameObjectPositionBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }
  }
View Full Code Here


  /**
   * Sends updates for game items to the given player
   */
  private void updateItems(Player p) {
    itemPositionBuilder.setPlayer(p);
    RSCPacket temp = itemPositionBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }
  }
View Full Code Here

  /**
   * Update appearance of any npcs the given player should be aware of
   */
  private void updateNpcApperances(Player p) {
    npcApperanceBuilder.setPlayer(p);
    RSCPacket temp = npcApperanceBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }

View Full Code Here

  /**
   * Sends updates for npcs to the given player
   */
  private void updateNpcPositions(Player p) {
    npcPositionPacketBuilder.setPlayer(p);
    RSCPacket temp = npcPositionPacketBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }
  }
View Full Code Here

   * Update appearance of the given player, and any players they should be
   * aware of
   */
  private void updatePlayerApperances(Player p) {
    playerApperanceBuilder.setPlayer(p);
    RSCPacket temp = playerApperanceBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }
  }
View Full Code Here

   * Update positions of the given player, and any players they should be
   * aware of
   */
  private void updatePlayerPositions(Player p) {
    playerPositionBuilder.setPlayer(p);
    RSCPacket temp = playerPositionBuilder.getPacket();
    if (temp != null) {
      p.getActionSender().addPacket(temp);
      // p.getSession().write(temp);
    }
  }
View Full Code Here

  /**
   * Sends updates for wall objects to the given player
   */
  private void updateWallObjects(Player p) {
    wallObjectPositionPacketBuilder.setPlayer(p);
    RSCPacket temp = wallObjectPositionPacketBuilder.getPacket();
    if (temp != null) {
      // p.getSession().write(temp);
      p.getActionSender().addPacket(temp);
    }
  }
View Full Code Here

      Logger.error(new Exception("Wrong packet type! "
          + message.toString()));
      return;
    }
    try {
      RSCPacket p = (RSCPacket) message;
      byte[] data = p.getData();
      int dataLength = data.length;
      ByteBuffer buffer;
      // byte[] debug = new byte[dataLength + 4];
      if (!p.isBare()) {
        buffer = ByteBuffer.allocate(dataLength + 3);
        byte[] outlen = { (byte) (dataLength >> 8), (byte) (dataLength) };
        buffer.put(outlen);
        // debug[0] = outlen[0]; debug[1] = outlen[1];
        int id = p.getID();
        // debug[2] = (byte)offset; debug[3] = (byte)id;
        buffer.put((byte) id);
      } else {
        buffer = ByteBuffer.allocate(dataLength);
      }
View Full Code Here

   * @return A <code>RSCPacket</code> object
   */
  public RSCPacket toPacket() {
    byte[] data = new byte[curLength];
    System.arraycopy(payload, 0, data, 0, curLength);
    return new RSCPacket(null, pID, data, bare);
  }
View Full Code Here

            return true;
          }
          byte[] payload = new byte[length - 1];
          int id = in.get() & 0xff;
          in.get(payload);
          RSCPacket p = new RSCPacket(session, id, payload);
          out.write(p);
          return true;
        } else {
          in.rewind();
          return false;
View Full Code Here

TOP

Related Classes of org.moparscape.msc.gs.connection.RSCPacket

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.