Skip to content

Commit 439a51d

Browse files
committed
still...
1 parent 335bd19 commit 439a51d

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mod_name=Channel
3030
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3131
mod_license=GNU GPL 3.0
3232
# The mod version. See https://semver.org/
33-
mod_version=26.1.2-14+alpha
33+
mod_version=26.1.2-15+alpha
3434
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
3535
# This should match the base package used for the mod sources.
3636
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/cn/ussshenzhou/channel/subspace/client/SubspaceConnection.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ protected void initChannel(SocketChannel ch) {
212212
activelyDisconnect = false;
213213
} else {
214214
LogUtils.getLogger().warn("Disconnected from subspace. Reconnecting in 10s...");
215+
MicrophoneHud.setStatus(MicrophoneHud.Status.SUBSPACE);
215216
reconnectFuture = EVENT_LOOP_GROUP.schedule(() -> connect(packet), 10, TimeUnit.SECONDS);
216217
}
217218
channel = null;
@@ -221,6 +222,7 @@ protected void initChannel(SocketChannel ch) {
221222
MicrophoneHud.setStatus(MicrophoneHud.Status.STANDBY);
222223
} else {
223224
LogUtils.getLogger().error("Failed to connect to subspace server. Try again in 10s...");
225+
MicrophoneHud.setStatus(MicrophoneHud.Status.SUBSPACE);
224226
reconnectFuture = EVENT_LOOP_GROUP.schedule(() -> connect(packet), 10, TimeUnit.SECONDS);
225227
channel = null;
226228
}

src/main/java/cn/ussshenzhou/channel/subspace/server/SubspaceConnection.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ public static void send(SubspacePacket packet) {
101101
}
102102
}
103103

104-
public static void changeSubspace() {
105-
activelyDisconnect = true;
106-
if (channel != null) {
107-
channel.close();
108-
}
109-
connect();
110-
}
111-
112104
public static void shutdown() {
113105
activelyDisconnect = true;
114106
if (channel != null) {
@@ -124,7 +116,7 @@ public static void newPlayer(Player player) {
124116
SubspaceConnection.send(new PlayerLoginPacket(token, player.getUUID(), player.getId()));
125117
SubspaceConnection.send(new DataUpdatePacket());
126118
var cfg = ChannelServerConfig.get();
127-
NetworkHelper.sendToPlayer((ServerPlayer) player, new SubspaceInitPacket(token, cfg.subspaceProtocol, cfg.subspaceAddress, cfg.subspaceClientPort, cfg.subspaceSecurityLevel));
119+
EVENT_LOOP_GROUP.schedule(() -> NetworkHelper.sendToPlayer((ServerPlayer) player, new SubspaceInitPacket(token, cfg.subspaceProtocol, cfg.subspaceAddress, cfg.subspaceClientPort, cfg.subspaceSecurityLevel)), 3, TimeUnit.SECONDS);
128120
}
129121

130122
public static boolean using() {

0 commit comments

Comments
 (0)