mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
Format code.
This commit is contained in:
parent
c5880f0627
commit
ca0dec4a2d
12 changed files with 19 additions and 19 deletions
|
@ -40,7 +40,7 @@ public interface ConnectionListener {
|
|||
/**
|
||||
* Binds the listener to its host and port.
|
||||
*
|
||||
* @param wait Whether to wait for the listener to finish binding.
|
||||
* @param wait Whether to wait for the listener to finish binding.
|
||||
* @param callback Callback to call when the listener has finished binding.
|
||||
*/
|
||||
public void bind(boolean wait, Runnable callback);
|
||||
|
@ -60,7 +60,7 @@ public interface ConnectionListener {
|
|||
/**
|
||||
* Closes the listener.
|
||||
*
|
||||
* @param wait Whether to wait for the listener to finish closing.
|
||||
* @param wait Whether to wait for the listener to finish closing.
|
||||
* @param callback Callback to call when the listener has finished closing.
|
||||
*/
|
||||
public void close(boolean wait, Runnable callback);
|
||||
|
|
|
@ -2,12 +2,12 @@ package com.github.steveice10.packetlib;
|
|||
|
||||
import com.github.steveice10.packetlib.event.server.ServerBoundEvent;
|
||||
import com.github.steveice10.packetlib.event.server.ServerClosedEvent;
|
||||
import com.github.steveice10.packetlib.event.server.ServerClosingEvent;
|
||||
import com.github.steveice10.packetlib.event.server.ServerEvent;
|
||||
import com.github.steveice10.packetlib.event.server.ServerListener;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
import com.github.steveice10.packetlib.event.server.SessionAddedEvent;
|
||||
import com.github.steveice10.packetlib.event.server.SessionRemovedEvent;
|
||||
import com.github.steveice10.packetlib.event.server.ServerClosingEvent;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.github.steveice10.packetlib;
|
||||
|
||||
import com.github.steveice10.packetlib.event.session.SessionEvent;
|
||||
import com.github.steveice10.packetlib.event.session.SessionListener;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
import com.github.steveice10.packetlib.event.session.SessionEvent;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.github.steveice10.packetlib.event.session;
|
||||
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
|
||||
/**
|
||||
* Called when the session receives a packet.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.github.steveice10.packetlib.event.session;
|
||||
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
|
||||
/**
|
||||
* Called when the session has sent a packet.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.Client;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.Channel;
|
||||
|
@ -12,7 +13,6 @@ import io.netty.channel.nio.NioEventLoopGroup;
|
|||
import io.netty.channel.oio.OioEventLoopGroup;
|
||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import io.netty.util.concurrent.Future;
|
||||
import com.github.steveice10.packetlib.Client;
|
||||
|
||||
import javax.naming.directory.InitialDirContext;
|
||||
import java.net.Proxy;
|
||||
|
@ -80,7 +80,7 @@ public class TcpClientSession extends TcpSession {
|
|||
environment.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
|
||||
environment.put("java.naming.provider.url", "dns:");
|
||||
|
||||
String[] result = new InitialDirContext(environment).getAttributes(getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host, new String[] { "SRV" }).get("srv").get().toString().split(" ", 4);
|
||||
String[] result = new InitialDirContext(environment).getAttributes(getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host, new String[] {"SRV"}).get("srv").get().toString().split(" ", 4);
|
||||
host = result[3];
|
||||
port = Integer.parseInt(result[2]);
|
||||
} catch(Throwable t) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.event.session.PacketReceivedEvent;
|
||||
import com.github.steveice10.packetlib.io.NetInput;
|
||||
import com.github.steveice10.packetlib.io.NetOutput;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.tcp.io.ByteBufNetInput;
|
||||
import com.github.steveice10.packetlib.tcp.io.ByteBufNetOutput;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.ByteToMessageCodec;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.tcp.io.ByteBufNetInput;
|
||||
import com.github.steveice10.packetlib.tcp.io.ByteBufNetOutput;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
@ -7,7 +8,6 @@ import io.netty.buffer.Unpooled;
|
|||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.ByteToMessageCodec;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.event.session.ConnectedEvent;
|
||||
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
|
||||
import com.github.steveice10.packetlib.event.session.DisconnectingEvent;
|
||||
import com.github.steveice10.packetlib.event.session.PacketReceivedEvent;
|
||||
import com.github.steveice10.packetlib.event.session.PacketSendingEvent;
|
||||
import com.github.steveice10.packetlib.event.session.PacketSentEvent;
|
||||
import com.github.steveice10.packetlib.event.session.SessionEvent;
|
||||
import com.github.steveice10.packetlib.event.session.SessionListener;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
import com.github.steveice10.packetlib.event.session.SessionEvent;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
|
@ -17,10 +21,6 @@ import io.netty.handler.timeout.ReadTimeoutException;
|
|||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||
import io.netty.handler.timeout.WriteTimeoutException;
|
||||
import io.netty.handler.timeout.WriteTimeoutHandler;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.event.session.ConnectedEvent;
|
||||
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
|
||||
import com.github.steveice10.packetlib.event.session.PacketSentEvent;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketAddress;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.SessionFactory;
|
||||
import com.github.steveice10.packetlib.Client;
|
||||
import com.github.steveice10.packetlib.ConnectionListener;
|
||||
import com.github.steveice10.packetlib.Server;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.SessionFactory;
|
||||
|
||||
import java.net.Proxy;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.github.steveice10.packetlib.tcp.io;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import com.github.steveice10.packetlib.io.NetOutput;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
|
Loading…
Reference in a new issue