Skip to content

Commit

Permalink
allow custom usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Apr 23, 2020
1 parent 24deaf8 commit 6c2eed3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public boolean handle(Server server, Packet packet, Matcher message) {

boolean anonym = true; //!Database.getInstance().authenticateUser(username,password);
if (anonym) {
username = "~anonym-" + (int) (Math.random() * 10000);
if (username.length() == 0) {
username = "~anonym-" + (int) (Math.random() * 10000);
// Warning: Currently duplicates wont get noticed...
}
}

Player player = (Player) packet.getChannel().getAttachment();
Expand Down

0 comments on commit 6c2eed3

Please sign in to comment.