Limit to 1 capital letter to avoid issues with caps filter
This commit is contained in:
parent
b91c9418fb
commit
ed99d1c83c
|
|
@ -15,8 +15,17 @@ public class Authentication {
|
|||
StringBuilder salt = new StringBuilder();
|
||||
Random rnd = new Random();
|
||||
|
||||
boolean hasCaps = false;
|
||||
|
||||
while (salt.length() < 6) {
|
||||
int index = (int) (rnd.nextFloat() * (float) randChars.length());
|
||||
if (index < 26) { //Hot fix for too many caps and the chat filter blocking it
|
||||
if (hasCaps) {
|
||||
index += 26;
|
||||
} else {
|
||||
hasCaps = true;
|
||||
}
|
||||
}
|
||||
salt.append(randChars.charAt(index));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user