forked from LogBlock/LogBlock
Player name auto-completion does more harm than good, so don't do that
Fixes #388
This commit is contained in:
@ -585,11 +585,8 @@ public final class QueryParams implements Cloneable {
|
|||||||
if (playerName.contains("\"")) {
|
if (playerName.contains("\"")) {
|
||||||
players.add(playerName.replaceAll("[^a-zA-Z0-9_]", ""));
|
players.add(playerName.replaceAll("[^a-zA-Z0-9_]", ""));
|
||||||
} else {
|
} else {
|
||||||
final List<Player> matches = logblock.getServer().matchPlayer(playerName);
|
final Player matches = logblock.getServer().getPlayerExact(playerName);
|
||||||
if (matches.size() > 1) {
|
players.add(matches != null ? matches.getName() : playerName.replaceAll("[^a-zA-Z0-9_]", ""));
|
||||||
throw new IllegalArgumentException("Ambiguous playername '" + param + "'");
|
|
||||||
}
|
|
||||||
players.add(matches.size() == 1 ? matches.get(0).getName() : playerName.replaceAll("[^a-zA-Z0-9_]", ""));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user