class GetIpCommand implements ExecutableCommand {

    @Override
    public void executeCommand(CommandSender sender, List<String> arguments) {
        String playerName = arguments.get(0);
        Player player = bukkitService.getPlayerExact(playerName);
        PlayerAuth auth = dataSource.getAuth(playerName);

        if (player != null) {
            sender.sendMessage("Current IP of " + player.getName() + " is " + PlayerUtils.getPlayerIp(player)
                + ":" + player.getAddress().getPort());
        }

        if (auth == null) {
            String displayName = player == null ? playerName : player.getName();
            sender.sendMessage(displayName + " is not registered in the database");
        } else {
            sender.sendMessage("Database: last IP: " + auth.getLastIp() + ", registration IP: "
                + auth.getRegistrationIp());
        }
    }

}