use of POGOProtos.Networking.Requests.Messages.CheckChallengeMessageOuterClass.CheckChallengeMessage in project PokeGOAPI-Java by Grover-c13.
the class PokemonGo method checkChallenge.
/**
* Checks for a challenge / captcha
*
* @return the new challenge URL, if any
* @throws RequestFailedException if an exception occurred while sending requests
* @deprecated CHECK_CHALLENGE is sent as a common request, should not be needed
*/
@Deprecated
public String checkChallenge() throws RequestFailedException {
CheckChallengeMessage message = CheckChallengeMessage.newBuilder().build();
try {
ServerRequest request = new ServerRequest(RequestType.CHECK_CHALLENGE, message);
ByteString responseData = getRequestHandler().sendServerRequests(request, false);
CheckChallengeResponse response = CheckChallengeResponse.parseFrom(responseData);
String newChallenge = response.getChallengeUrl();
if (response.getShowChallenge() && newChallenge != null && newChallenge.length() > 0) {
updateChallenge(newChallenge, true);
return newChallenge;
}
} catch (InvalidProtocolBufferException e) {
throw new RequestFailedException(e);
}
return null;
}
Aggregations