[FEATURE][FIX] Проверка зарегистрирован ли уже пользователь

This commit is contained in:
Gravit 2019-07-01 15:04:28 +07:00
parent 5df618787f
commit c8211ae7dd
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -24,6 +24,12 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception
sendError("Hash invalid");
return;
}
User checkUser = server.userService.findUserByUsername(login);
if(checkUser != null)
{
sendError("User already register");
return;
}
User user = new User();
user.username = login;
user.setPassword(password);