示例#1
0
  public static void sendEncapsulated(Session session, BinaryConvertible packet) {
    EncapsulatedPacket reply = new EncapsulatedPacket();
    reply.setBuffer(packet);
    reply.setReliability(EncapsulatedPacket.RELIABLE_ORDERED);
    reply.setOrderIndex(0);
    reply.setOrderChannel(1);

    session.getReliableManager().addEncapsulatedToQueue(reply, SendPriority.IMMEDIATE);
  }
示例#2
0
  public void onPlayerJoin(Session session) {
    InetSocketAddress address = this.monitor.getBestServer().getAddress();
    this.getLogger()
        .info("Transferring player '" + session.getAddress() + "' to address '" + address + "'");

    StrangePacket packet = new StrangePacket();
    packet.setDestination(address);

    MineDoor.sendEncapsulated(session, packet);
  }