Format code.

This commit is contained in:
Steveice10 2017-09-01 12:55:00 -07:00
parent c5880f0627
commit ca0dec4a2d
12 changed files with 19 additions and 19 deletions

View file

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

View file

@ -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;

View file

@ -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;

View file

@ -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.

View file

@ -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.

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;