Package org.moparscape.msc.gs.connection

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


      } else if (!newSettings[i] && player.getPrivacySetting(i)) {
        builder.setOn(false);
      } else {
        continue;
      }
      LSPacket packet = builder.getPacket();
      if (packet != null) {
        Instance.getServer().getLoginConnector().getSession()
            .write(packet);
      }
    }
View Full Code Here


    if (player == null) {
      return;
    }
    builder.setUID(uID);
    builder.setPlayer(player);
    LSPacket temp = builder.getPacket();
    if (temp != null) {
      session.write(temp);
    }
  }
View Full Code Here

    long uID = ((LSPacket) p).getUID();
    Logger.event("LOGIN_SERVER requested player information (uID: " + uID
        + ")");
    builder.setUID(uID);
    builder.setPlayer(world.getPlayer(p.readLong()));
    LSPacket temp = builder.getPacket();
    if (temp != null) {
      session.write(temp);
    }
  }
View Full Code Here

  public void handlePacket(Packet p, IoSession session) throws Exception {
    long uID = ((LSPacket) p).getUID();
    Logger.event("LOGIN_SERVER requested stats (uID: " + uID + ")");
    builder.setUID(uID);
    LSPacket temp = builder.getPacket();
    if (temp != null) {
      session.write(temp);
    }
  }
View Full Code Here

  public void handlePacket(Packet p, IoSession session) throws Exception {
    long uID = ((LSPacket) p).getUID();
    Logger.event("LOGIN_SERVER requested player list (uID: " + uID + ")");
    builder.setUID(uID);
    LSPacket temp = builder.getPacket();
    if (temp != null) {
      session.write(temp);
    }
  }
View Full Code Here

        int id = in.getUnsigned();
        long uid = in.getLong();
        in.get(payload);

        out.write(new LSPacket(session, id, uid, payload));
        return true;
      } else {
        in.rewind();
        return false;
      }
View Full Code Here

    if (!(message instanceof LSPacket)) {
      Logger.error(new Exception("Wrong packet type! "
          + message.toString()));
      return;
    }
    LSPacket p = (LSPacket) message;
    byte[] data = p.getData();
    int packetLength = data.length;
    ByteBuffer buffer;
    if (!p.isBare()) {
      buffer = ByteBuffer.allocate(data.length + 13);
      packetLength += 9;

      buffer.putInt(packetLength);
      buffer.put((byte) p.getID());
      buffer.putLong(p.getUID());

    } else {
      buffer = ByteBuffer.allocate(data.length);
    }
    buffer.put(data, 0, data.length);
View Full Code Here

    builder.setPlayer(player);
    builder.setIndex(idx);
    builder.setOn(on);

    LSPacket packet = builder.getPacket();
    if (packet != null) {
      Instance.getServer().getLoginConnector().getSession().write(packet);
    }
  }
View Full Code Here

  public void save() {

    SavePacketBuilder builder = new SavePacketBuilder();
    builder.setPlayer(this);
    LSPacket temp = builder.getPacket();
    if (temp != null) {
      Instance.getServer().getLoginConnector().getSession().write(temp);
    }

  }
View Full Code Here

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

TOP

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

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.