mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
Ported library to Netty 4.1.4 (Netty 5 has been discontinued) by modifying TcpSession.java and pom.xml. Fixed a bug in Server.java where isListening() would throw a NullPointerException if called before bind(). Removed unused imports of java.net.InetAddress in Session.java and TcpSession.java. Updated Maven plugin versions in pom.xml.
This commit is contained in:
parent
b5bfe24517
commit
cc4d9869bb
4 changed files with 13 additions and 13 deletions
20
pom.xml
20
pom.xml
|
@ -65,7 +65,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-all</artifactId>
|
<artifactId>netty-all</artifactId>
|
||||||
<version>5.0.0.Alpha2</version>
|
<version>4.1.4.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -76,20 +76,21 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>3.6.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.7</source>
|
||||||
<target>1.7</target>
|
<target>1.7</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>2.6</version>
|
<version>3.0.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-sources</id>
|
<id>attach-sources</id>
|
||||||
|
@ -100,8 +101,9 @@
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.10.4</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-javadocs</id>
|
<id>attach-javadocs</id>
|
||||||
|
@ -114,7 +116,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>2.4.1</version>
|
<version>2.4.3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
|
|
|
@ -242,7 +242,7 @@ public class Server {
|
||||||
* @return Whether the server is listening.
|
* @return Whether the server is listening.
|
||||||
*/
|
*/
|
||||||
public boolean isListening() {
|
public boolean isListening() {
|
||||||
return this.listener.isListening();
|
return this.listener != null && this.listener.isListening();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,7 +5,6 @@ import org.spacehq.packetlib.event.session.SessionListener;
|
||||||
import org.spacehq.packetlib.packet.Packet;
|
import org.spacehq.packetlib.packet.Packet;
|
||||||
import org.spacehq.packetlib.packet.PacketProtocol;
|
import org.spacehq.packetlib.packet.PacketProtocol;
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.spacehq.packetlib.packet.Packet;
|
||||||
import org.spacehq.packetlib.packet.PacketProtocol;
|
import org.spacehq.packetlib.packet.PacketProtocol;
|
||||||
|
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -371,7 +370,7 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> imp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void messageReceived(ChannelHandlerContext ctx, Packet packet) throws Exception {
|
protected void channelRead0(ChannelHandlerContext ctx, Packet packet) throws Exception {
|
||||||
if(!packet.isPriority()) {
|
if(!packet.isPriority()) {
|
||||||
this.packets.add(packet);
|
this.packets.add(packet);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue