Fixed: наименование метода

This commit is contained in:
Reider745
2025-01-07 12:54:57 +03:00
parent 483479d81e
commit 8edabac056
5 changed files with 8 additions and 8 deletions
@@ -332,7 +332,7 @@ public class InnerCoreServer {
NativeCallback.onLevelCreated();
if(isEnabledSockets())
if(isSocketEnabled())
Logger.warning("Socket connections are enabled, it is possible that the connection is not stable");
}
@@ -523,7 +523,7 @@ public class InnerCoreServer {
return getPropertyString("pack-version", "2.3.1b123");
}
public static boolean isEnabledSockets() {
public static boolean isSocketEnabled() {
return InnerCoreServer.getPropertyBoolean("socket-server-enabled", false);
}
@@ -67,7 +67,7 @@ public class PlayerHooks implements HookClass {
if(player.getNetworkSession() instanceof RakNetPlayerSessionHooks session)
result = session.getInnerCoreConnectionClient();
if(InnerCoreServer.isEnabledSockets()) {
if(InnerCoreServer.isSocketEnabled()) {
List<ConnectedClient> clients = Network.getSingleton().getServer().getConnectedClients();
for (ConnectedClient client : clients)
if (client.getChannelInterface().getChannel().getProtocolId() == SocketDataChannel.PROTOCOL_ID && equalsAddress(player.getSocketAddress().toString(),
@@ -115,7 +115,7 @@ public class NetworkHooks implements HookClass {
network.registerPacket(InnerCoreServer.PROTOCOL, LoginPacketFix.NETWORK_ID, LoginPacketFix.class);
}
@Inject(className = "cn.nukkit.network.protocol.BiomeDefinitionListPacket")
@Inject(className = "cn.nukkit.network.protocol.BiomeDefinitionListPacket", type = TypeHook.BEFORE_REPLACE)
public static void encode(BiomeDefinitionListPacket self) {
BiomesMethods.encode(self);
}
@@ -82,7 +82,7 @@ public class NetworkConfig {
setLocalNativeProtocolForced(EngineConfig.getBoolean("network.local_native_protocol_forced", false));
// enable socket server
setDefaultPort(InnerCoreServer.getPropertyInt("socket-port", 2304));
setSocketConnectionAllowed(InnerCoreServer.isEnabledSockets());
setSocketConnectionAllowed(InnerCoreServer.isSocketEnabled());
InnerCorePacket.sendInfo = getServerDetectionPacket();
}
@@ -91,7 +91,7 @@ public class NetworkConfig {
json.put("server", true);
json.put("socket_port", defaultPort);
json.put("biomes", BiomesMethods.getCustomBiomes());
json.put("socket_enabled", InnerCoreServer.isEnabledSockets());
json.put("socket_enabled", InnerCoreServer.isSocketEnabled());
byte[] bytes = json.toString().getBytes();
InnerCorePacket packet = new InnerCorePacket();
@@ -152,10 +152,10 @@ public class ConnectedClient extends Thread implements ChannelInterface.OnPacket
if (remainingInitializationPackets.isEmpty()) {
setClientState(ClientState.OPEN);
}
if(InnerCoreServer.isDebugInnerCoreNetwork()) {
System.out.println(remainingInitializationPackets.size());
System.out.println("INIT - " + remainingInitializationPackets.size());
remainingInitializationPackets.forEach(System.out::println);
System.out.println("======");
}
server.addWatchdogAction(server.getConfig().getInitializationTimeout(), () -> {