File tree Expand file tree Collapse file tree
src/main/java/cn/ussshenzhou/channel/subspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,13 +213,15 @@ protected void initChannel(SocketChannel ch) {
213213 if (!activelyDisconnect ) {
214214 LogUtils .getLogger ().warn ("Disconnected from subspace. Reconnecting in 10s..." );
215215 reconnectFuture = group .schedule (() -> connect (packet ), 10 , TimeUnit .SECONDS );
216+ channel = null ;
216217 }
217218 });
218219 send (new HandshakePacket ());
219220 MicrophoneHud .setStatus (MicrophoneHud .Status .STANDBY );
220221 } else {
221222 LogUtils .getLogger ().error ("Failed to connect to subspace server. Try again in 10s..." );
222223 reconnectFuture = group .schedule (() -> connect (packet ), 10 , TimeUnit .SECONDS );
224+ channel = null ;
223225 }
224226 });
225227 }
Original file line number Diff line number Diff line change @@ -75,19 +75,21 @@ protected void initChannel(SocketChannel ch) {
7575 if (!activelyDisconnect ) {
7676 LogUtils .getLogger ().warn ("Disconnected from subspace. Reconnecting in 10s..." );
7777 group .schedule (SubspaceConnection ::connect , 10 , TimeUnit .SECONDS );
78+ channel = null ;
7879 }
7980 });
8081 send (new InitPacket ());
8182 LogUtils .getLogger ().info ("Subspace server connected." );
8283 group .schedule (() -> {
83- LockSupport .parkNanos (TimeUnit .MILLISECONDS .toNanos (1000 ));
84+ LockSupport .parkNanos (TimeUnit .SECONDS .toNanos (3000 ));
8485 if (channel .isActive () && ServerLifecycleHooks .getCurrentServer () != null ) {
8586 ServerLifecycleHooks .getCurrentServer ().getPlayerList ().getPlayers ().forEach (SubspaceConnection ::newPlayer );
8687 }
8788 }, 1 , TimeUnit .SECONDS );
8889 } else {
8990 LogUtils .getLogger ().error ("Failed to connect to subspace server. Try again in 10s..." );
9091 group .schedule (SubspaceConnection ::connect , 10 , TimeUnit .SECONDS );
92+ channel = null ;
9193 }
9294 });
9395 }
You can’t perform that action at this time.
0 commit comments