Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
LOOHP committed Aug 7, 2022
1 parent cfbd995 commit 21a20af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>com.loohp</groupId>
<artifactId>Limbo</artifactId>
<name>Limbo</name>
<version>0.6.17-ALPHA</version>
<version>0.6.18-ALPHA</version>

<description>Standalone Limbo Minecraft Server.</description>
<url>https://github.com/LOOHP/Limbo</url>
Expand Down
23 changes: 4 additions & 19 deletions src/main/java/com/loohp/limbo/network/ClientConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,7 @@ public void run() {

state = ClientState.LEGACY;
channel.output.writeByte(255);
String str = inetAddress.getHostName() + ":" + clientSocket.getPort();
if(!properties.isLogPlayerIPAddresses()) {
str = "<ip address withheld>" + ":" + clientSocket.getPort();
}
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort();
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Legacy Status has pinged");
ServerProperties p = Limbo.getInstance().getServerProperties();
StatusPingEvent event = Limbo.getInstance().getEventsManager().callEvent(new StatusPingEvent(this, p.getVersionString(), p.getProtocol(), p.getMotd(), p.getMaxPlayers(), Limbo.getInstance().getPlayers().size(), p.getFavicon().orElse(null)));
Expand Down Expand Up @@ -343,10 +340,7 @@ public void run() {
if (packetIn instanceof PacketStatusInRequest) {
ServerProperties properties = Limbo.getInstance().getServerProperties();

String str = inetAddress.getHostName() + ":" + clientSocket.getPort();
if(!properties.isLogPlayerIPAddresses()) {
str = "<ip address withheld>" + ":" + clientSocket.getPort();
}
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort();
if (Limbo.getInstance().getServerProperties().handshakeVerboseEnabled()) {
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Handshake Status has pinged");
}
Expand Down Expand Up @@ -505,10 +499,7 @@ public void run() {
PacketPlayOutPlayerAbilities abilities = new PacketPlayOutPlayerAbilities(0.05F, 0.1F, flags.toArray(new PlayerAbilityFlags[flags.size()]));
sendPacket(abilities);

String str = inetAddress.getHostName() + ":" + clientSocket.getPort() + "|" + player.getName() + "(" + player.getUniqueId() + ")";
if(!properties.isLogPlayerIPAddresses()) {
str = "<ip address withheld>" + ":" + clientSocket.getPort() + "|" + player.getName() + "(" + player.getUniqueId() + ")";
}
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort() + "|" + player.getName() + "(" + player.getUniqueId() + ")";
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player had connected to the Limbo server!");

player.playerInteractManager.update();
Expand Down Expand Up @@ -676,15 +667,9 @@ public void run() {

Limbo.getInstance().getEventsManager().callEvent(new PlayerQuitEvent(player));

str = inetAddress.getHostName() + ":" + clientSocket.getPort() + "|" + player.getName();
if(!properties.isLogPlayerIPAddresses()) {
str = "<ip address withheld>" + ":" + clientSocket.getPort() + clientSocket.getPort() + "|" + player.getName();
}

str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort() + "|" + player.getName();
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player had disconnected!");

}

} catch (Exception ignored) {
}

Expand Down

0 comments on commit 21a20af

Please sign in to comment.