Skip to content

Commit

Permalink
Move ServerNetworkIo to net.minecraft.server.network (#451)
Browse files Browse the repository at this point in the history
* Move ServerNetworkIo to net.minecraft.server.network

* Fix javadoc reference to ServerNetworkIo
  • Loading branch information
kb-1000 authored Jun 26, 2023
1 parent 92bcfce commit 8a45631
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mappings/net/minecraft/network/ClientConnection.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CLASS net/minecraft/unmapped/C_oasmcckk net/minecraft/network/ClientConnection
FIELD f_vcukytvt errored Z
FIELD f_wborsynf NETWORK_MARKER Lorg/slf4j/Marker;
FIELD f_wdeykuqe disconnected Z
FIELD f_wfrrroev pendingDisconnectReason Lnet/minecraft/unmapped/C_rdaqiwdt;
FIELD f_yhdjpmsl CURRENT_PACKET_COUNTER_WEIGHT F
COMMENT Represents when the average packet counter is updated, what percent of the
COMMENT value of the average counter is set from the current counter.
Expand All @@ -47,6 +48,10 @@ CLASS net/minecraft/unmapped/C_oasmcckk net/minecraft/network/ClientConnection
ARG 1 context
ARG 2 ex
METHOD m_akpgjfcu sendQueuedPackets ()V
METHOD m_apccqkse connect (Ljava/net/InetSocketAddress;ZLnet/minecraft/unmapped/C_oasmcckk;)Lio/netty/channel/ChannelFuture;
ARG 0 address
ARG 1 useEpoll
ARG 2 connection
METHOD m_bgcagbfi sendImmediately (Lnet/minecraft/unmapped/C_zyjtrjrl;Lnet/minecraft/unmapped/C_zddpfpkk;)V
ARG 1 packet
ARG 2 listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CLASS net/minecraft/unmapped/C_lvasmajl net/minecraft/server/network/LocalServer
COMMENT <p>A local connection is one between a Minecraft client and the
COMMENT Integrated Server it is running.
COMMENT
COMMENT @see net.minecraft.server.ServerNetworkIo#bindLocal()
COMMENT @see ServerNetworkIo#bindLocal()
FIELD f_ioyqbajs connection Lnet/minecraft/unmapped/C_oasmcckk;
FIELD f_novpmswc server Lnet/minecraft/server/MinecraftServer;
METHOD <init> (Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/unmapped/C_oasmcckk;)V
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CLASS net/minecraft/unmapped/C_mitbewqx net/minecraft/server/ServerNetworkIo
CLASS net/minecraft/unmapped/C_mitbewqx net/minecraft/server/network/ServerNetworkIo
FIELD f_gtjrlflk DEFAULT_CHANNEL Lnet/minecraft/unmapped/C_oabgzozl;
FIELD f_nqagadkm connections Ljava/util/List;
FIELD f_rptjqzhp active Z
Expand Down

1 comment on commit 8a45631

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With commit 8a45631, 5 file(s) were updated with 21 line(s) added and 18 removed compared to the latest Quilt Mappings version.

View the diff here:
diff -bur namedTargetSrc/net/minecraft/client/gui/screen/ConnectScreen.java namedSrc/net/minecraft/client/gui/screen/ConnectScreen.java
--- namedTargetSrc/net/minecraft/client/gui/screen/ConnectScreen.java	2023-06-26 16:13:17.888318362 +0000
+++ namedSrc/net/minecraft/client/gui/screen/ConnectScreen.java	2023-06-26 16:11:20.211225772 +0000
@@ -175,7 +175,7 @@
                   }
 
                   lv = new ClientConnection(NetworkSide.C2S);
-                  ConnectScreen.this.f_unvbqcut = ClientConnection.m_apccqkse(inetSocketAddress, client.options.shouldUseNativeTransport(), lv);
+                  ConnectScreen.this.f_unvbqcut = ClientConnection.connect(inetSocketAddress, client.options.shouldUseNativeTransport(), lv);
                }
 
                ConnectScreen.this.f_unvbqcut.syncUninterruptibly();
diff -bur namedTargetSrc/net/minecraft/network/ClientConnection.java namedSrc/net/minecraft/network/ClientConnection.java
--- namedTargetSrc/net/minecraft/network/ClientConnection.java	2023-06-26 16:13:17.824317726 +0000
+++ namedSrc/net/minecraft/network/ClientConnection.java	2023-06-26 16:11:20.139225079 +0000
@@ -195,10 +195,11 @@
     */
    private boolean errored;
    /**
-    * Mapping not found
+    * @mapping {@literal hashed f_wfrrroev Lnet/minecraft/unmapped/C_oasmcckk;f_wfrrroev:Lnet/minecraft/unmapped/C_rdaqiwdt;}
+    * @mapping {@literal named pendingDisconnectReason Lnet/minecraft/network/ClientConnection;pendingDisconnectReason:Lnet/minecraft/text/Text;}
     */
    @Nullable
-   private volatile Text f_wfrrroev;
+   private volatile Text pendingDisconnectReason;
 
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_oasmcckk;<init>(Lnet/minecraft/unmapped/C_exeqxqdd;)V}
@@ -224,8 +225,8 @@
          LOGGER.error(LogUtils.FATAL_MARKER, "Failed to change protocol to handshake", var3);
       }
 
-      if (this.f_wfrrroev != null) {
-         this.disconnect(this.f_wfrrroev);
+      if (this.pendingDisconnectReason != null) {
+         this.disconnect(this.pendingDisconnectReason);
       }
    }
 
@@ -470,7 +471,7 @@
     */
    public void disconnect(Text disconnectReason) {
       if (this.channel == null) {
-         this.f_wfrrroev = disconnectReason;
+         this.pendingDisconnectReason = disconnectReason;
       }
 
       if (this.isOpen()) {
@@ -515,18 +516,19 @@
     */
    public static ClientConnection connect(InetSocketAddress address, boolean useEpoll) {
       ClientConnection lv = new ClientConnection(NetworkSide.C2S);
-      ChannelFuture channelFuture = m_apccqkse(address, useEpoll, lv);
+      ChannelFuture channelFuture = connect(address, useEpoll, lv);
       channelFuture.syncUninterruptibly();
       return lv;
    }
 
    /**
-    * Mapping not found
+    * @mapping {@literal hashed m_apccqkse Lnet/minecraft/unmapped/C_oasmcckk;m_apccqkse(Ljava/net/InetSocketAddress;ZLnet/minecraft/unmapped/C_oasmcckk;)Lio/netty/channel/ChannelFuture;}
+    * @mapping {@literal named connect Lnet/minecraft/network/ClientConnection;connect(Ljava/net/InetSocketAddress;ZLnet/minecraft/network/ClientConnection;)Lio/netty/channel/ChannelFuture;}
     */
-   public static ChannelFuture m_apccqkse(InetSocketAddress inetSocketAddress, boolean bl, ClientConnection arg) {
+   public static ChannelFuture connect(InetSocketAddress address, boolean useEpoll, ClientConnection connection) {
       Class<? extends SocketChannel> lv;
       Lazy<? extends EventLoopGroup> lv2;
-      if (Epoll.isAvailable() && bl) {
+      if (Epoll.isAvailable() && useEpoll) {
          lv = EpollSocketChannel.class;
          lv2 = EPOLL_CLIENT_IO_GROUP;
       } else {
@@ -548,9 +550,9 @@
 
             ChannelPipeline channelPipeline = channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30));
             ClientConnection.addHandlers(channelPipeline, NetworkSide.C2S);
-            channelPipeline.addLast("packet_handler", arg);
+            channelPipeline.addLast("packet_handler", connection);
          }
-      }).channel(lv).connect(inetSocketAddress.getAddress(), inetSocketAddress.getPort());
+      }).channel(lv).connect(address.getAddress(), address.getPort());
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/network/LegacyQueryHandler.java namedSrc/net/minecraft/network/LegacyQueryHandler.java
--- namedTargetSrc/net/minecraft/network/LegacyQueryHandler.java	2023-06-26 16:13:17.832317806 +0000
+++ namedSrc/net/minecraft/network/LegacyQueryHandler.java	2023-06-26 16:11:20.147225156 +0000
@@ -10,7 +10,7 @@
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.ServerNetworkIo;
+import net.minecraft.server.network.ServerNetworkIo;
 import org.slf4j.Logger;
 
 /**
@@ -30,13 +30,13 @@
    public static final int LEGACY_FAKE_PROTOCOL_VERSION = 127;
    /**
     * @mapping {@literal hashed f_ukmmwxsz Lnet/minecraft/unmapped/C_avdfsszh;f_ukmmwxsz:Lnet/minecraft/unmapped/C_mitbewqx;}
-    * @mapping {@literal named networkIo Lnet/minecraft/network/LegacyQueryHandler;networkIo:Lnet/minecraft/server/ServerNetworkIo;}
+    * @mapping {@literal named networkIo Lnet/minecraft/network/LegacyQueryHandler;networkIo:Lnet/minecraft/server/network/ServerNetworkIo;}
     */
    private final ServerNetworkIo networkIo;
 
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_avdfsszh;<init>(Lnet/minecraft/unmapped/C_mitbewqx;)V}
-    * @mapping {@literal named <init> Lnet/minecraft/network/LegacyQueryHandler;<init>(Lnet/minecraft/server/ServerNetworkIo;)V}
+    * @mapping {@literal named <init> Lnet/minecraft/network/LegacyQueryHandler;<init>(Lnet/minecraft/server/network/ServerNetworkIo;)V}
     */
    public LegacyQueryHandler(ServerNetworkIo networkIo) {
       this.networkIo = networkIo;
diff -bur namedTargetSrc/net/minecraft/server/MinecraftServer.java namedSrc/net/minecraft/server/MinecraftServer.java
--- namedTargetSrc/net/minecraft/server/MinecraftServer.java	2023-06-26 16:13:17.880318282 +0000
+++ namedSrc/net/minecraft/server/MinecraftServer.java	2023-06-26 16:11:20.199225657 +0000
@@ -86,6 +86,7 @@
 import net.minecraft.server.filter.TextStream;
 import net.minecraft.server.function.CommandFunctionManager;
 import net.minecraft.server.network.DemoServerPlayerInteractionManager;
+import net.minecraft.server.network.ServerNetworkIo;
 import net.minecraft.server.network.ServerPlayerEntity;
 import net.minecraft.server.network.ServerPlayerInteractionManager;
 import net.minecraft.server.network.SpawnLocating;
@@ -320,7 +321,7 @@
    private boolean needsDebugSetup;
    /**
     * @mapping {@literal hashed f_xpelegwm Lnet/minecraft/server/MinecraftServer;f_xpelegwm:Lnet/minecraft/unmapped/C_mitbewqx;}
-    * @mapping {@literal named networkIo Lnet/minecraft/server/MinecraftServer;networkIo:Lnet/minecraft/server/ServerNetworkIo;}
+    * @mapping {@literal named networkIo Lnet/minecraft/server/MinecraftServer;networkIo:Lnet/minecraft/server/network/ServerNetworkIo;}
     */
    private final ServerNetworkIo networkIo;
    /**
@@ -1986,7 +1987,7 @@
 
    /**
     * @mapping {@literal hashed m_hfghaotl Lnet/minecraft/server/MinecraftServer;m_hfghaotl()Lnet/minecraft/unmapped/C_mitbewqx;}
-    * @mapping {@literal named getNetworkIo Lnet/minecraft/server/MinecraftServer;getNetworkIo()Lnet/minecraft/server/ServerNetworkIo;}
+    * @mapping {@literal named getNetworkIo Lnet/minecraft/server/MinecraftServer;getNetworkIo()Lnet/minecraft/server/network/ServerNetworkIo;}
     */
    @Nullable
    public ServerNetworkIo getNetworkIo() {
diff -bur namedTargetSrc/net/minecraft/server/network/LocalServerHandshakeNetworkHandler.java namedSrc/net/minecraft/server/network/LocalServerHandshakeNetworkHandler.java
--- namedTargetSrc/net/minecraft/server/network/LocalServerHandshakeNetworkHandler.java	2023-06-26 16:13:17.892318401 +0000
+++ namedSrc/net/minecraft/server/network/LocalServerHandshakeNetworkHandler.java	2023-06-26 16:11:20.215225811 +0000
@@ -13,7 +13,7 @@
  * <p>A local connection is one between a Minecraft client and the
  * Integrated Server it is running.
  * 
- * @see net.minecraft.server.ServerNetworkIo#bindLocal()
+ * @see ServerNetworkIo#bindLocal()
  * 
  * @mapping {@literal hashed net/minecraft/unmapped/C_lvasmajl}
  * @mapping {@literal named net/minecraft/server/network/LocalServerHandshakeNetworkHandler}
Only in namedSrc/net/minecraft/server/network: ServerNetworkIo.java
Only in namedTargetSrc/net/minecraft/server: ServerNetworkIo.java

Please sign in to comment.