File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
raknet/src/main/java/com/nukkitx/network/raknet Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -155,12 +155,14 @@ private void onOpenConnectionReply2(ByteBuf buffer) {
155155 }
156156
157157 private void onConnectionRequestAccepted (ByteBuf buffer ) {
158- InetSocketAddress address = NetworkUtils .readAddress (buffer );
159- int systemIndex = buffer .readUnsignedShort ();
160- while (buffer .isReadable (16 )) {
158+ NetworkUtils .readAddress (buffer ); // our address
159+ buffer .readUnsignedShort (); // system index
160+ final int required = (this .address .getAddress () instanceof Inet6Address ? IPV6_MESSAGE_SIZE : IPV4_MESSAGE_SIZE ) + 16 ;
161+ while (buffer .isReadable (required )) {
161162 NetworkUtils .readAddress (buffer );
162163 }
163164 long pongTime = buffer .readLong ();
165+ buffer .readLong ();
164166
165167 this .sendNewIncomingConnection (pongTime );
166168
You can’t perform that action at this time.
0 commit comments