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); }
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); }