Skip to content

Commit

Permalink
Server: Remove null argument passed to varargs parameter in removePlayer
Browse files Browse the repository at this point in the history
This was logging a warning: "non-varargs call of varargs method with
inexact argument type for last parameter".

Since the parameter was always null, it can be removed from the calls.
  • Loading branch information
StenAL committed Jul 1, 2024
1 parent 3f9354a commit 396f275
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void process(Server server) {
Player player;
if ((player = (Player)channel.getAttachment()) != null) {
if (player.getLobby() != null) {
player.getLobby().removePlayer(player, Lobby.PART_REASON_USERLEFT,null);
player.getLobby().removePlayer(player, Lobby.PART_REASON_USERLEFT);
}
}
System.out.println("Client disconnected: " + channel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Pattern getPattern() {
public boolean handle(Server server, Packet packet, Matcher message) {
Player player = (Player) packet.getChannel().getAttachment();
if (message.group(1).contains("lobby")) {
player.getLobby().removePlayer(player, Lobby.PART_REASON_USERLEFT, null);
player.getLobby().removePlayer(player, Lobby.PART_REASON_USERLEFT);
}
packet.getChannel().disconnect();
packet.getChannel().close();
Expand Down

0 comments on commit 396f275

Please sign in to comment.