mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 13:57:49 +01:00
Use char[] for captcha generation.
This commit is contained in:
parent
983c7173d7
commit
13c4d654db
@ -61,10 +61,11 @@ public class Captcha extends AsyncCheck implements ICaptcha{
|
||||
@Override
|
||||
public void generateCaptcha(ChatConfig cc, ChatData data, boolean reset) {
|
||||
if (reset) data.captchTries = 0;
|
||||
data.captchaGenerated = "";
|
||||
final char[] chars = new char[cc.captchaLength];
|
||||
for (int i = 0; i < cc.captchaLength; i++)
|
||||
data.captchaGenerated += cc.captchaCharacters.charAt(random
|
||||
chars[i] = cc.captchaCharacters.charAt(random
|
||||
.nextInt(cc.captchaCharacters.length()));
|
||||
data.captchaGenerated = new String(chars);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user