Skip to content

Commit 85f9c82

Browse files
CervatorDarkWeird
andauthored
chore: remove some slow logging (#4936)
Co-authored-by: Nail Khanipov <[email protected]>
1 parent 7f2f0ca commit 85f9c82

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

engine/src/main/java/org/terasology/engine/network/internal/NetworkSystemImpl.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,8 @@
8080
import org.terasology.reflection.metadata.FieldMetadata;
8181

8282
import java.net.BindException;
83-
import java.net.InetAddress;
8483
import java.net.InetSocketAddress;
85-
import java.net.InterfaceAddress;
86-
import java.net.NetworkInterface;
87-
import java.net.SocketException;
8884
import java.util.Collection;
89-
import java.util.Enumeration;
9085
import java.util.List;
9186
import java.util.Map;
9287
import java.util.Optional;
@@ -177,40 +172,18 @@ public void host(int port, boolean dedicatedServer) throws HostingFailedExceptio
177172
logger.info("No server MOTD is defined");
178173
}
179174

180-
// enumerate all network interfaces that listen
181-
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
182-
183-
while (interfaces.hasMoreElements()) {
184-
NetworkInterface ifc = interfaces.nextElement();
185-
if (!ifc.isLoopback()) {
186-
for (InterfaceAddress ifadr : ifc.getInterfaceAddresses()) {
187-
// Exclude interfaces with the following key words to avoid common virtual and otherwise unlikely useful nics
188-
// TODO: Make this configurable via config.cfg?
189-
if (ifc.getDisplayName().contains("VirtualBox") || ifc.getDisplayName().contains("ISATAP")) {
190-
logger.info("Skipping filtered interface name {}", ifc.getDisplayName());
191-
} else {
192-
InetAddress adr = ifadr.getAddress();
193-
logger.info("Listening on network interface \"{}\", hostname \"{}\" ({})",
194-
ifc.getDisplayName(), adr.getCanonicalHostName(), adr.getHostAddress());
195-
}
196-
}
197-
}
198-
}
199175
if (serverChannelFuture.isSuccess()) {
200176
logger.info("Server started");
201177
}
202178
serverChannelFuture.sync();
203179
nextNetworkTick = time.getRealTimeInMs();
204-
} catch (SocketException e) {
205-
throw new HostingFailedException("Could not identify network interfaces", e);
206180
} catch (ChannelException e) {
207181
if (e.getCause() instanceof BindException) {
208182
throw new HostingFailedException("Port already in use (are you already hosting a game?)",
209183
e.getCause());
210184
} else {
211185
throw new HostingFailedException("Failed to host game", e.getCause());
212186
}
213-
214187
} catch (InterruptedException e) {
215188
shutdown();
216189
throw new HostingFailedException("Server has been interrupted", e.getCause());

0 commit comments

Comments
 (0)