Search in sources :

Example 1 with CheckAwardedBadgesMessage

use of POGOProtos.Networking.Requests.Messages.CheckAwardedBadgesMessageOuterClass.CheckAwardedBadgesMessage in project PokeGOAPI-Java by Grover-c13.

the class PlayerProfile method checkAndEquipBadges.

/**
 * Check and equip badges.
 *
 * @throws RequestFailedException if an exception occurred while sending requests
 * @deprecated use getMedals, which uses common requests to check for badges
 */
@Deprecated
public void checkAndEquipBadges() throws RequestFailedException {
    CheckAwardedBadgesMessage msg = CheckAwardedBadgesMessage.newBuilder().build();
    ServerRequest serverRequest = new ServerRequest(RequestType.CHECK_AWARDED_BADGES, msg);
    api.requestHandler.sendServerRequests(serverRequest, false);
    CheckAwardedBadgesResponse response;
    try {
        response = CheckAwardedBadgesResponse.parseFrom(serverRequest.getData());
    } catch (InvalidProtocolBufferException e) {
        throw new RequestFailedException(e);
    }
    this.updateAwardedMedals(response);
}
Also used : CheckAwardedBadgesMessage(POGOProtos.Networking.Requests.Messages.CheckAwardedBadgesMessageOuterClass.CheckAwardedBadgesMessage) RequestFailedException(com.pokegoapi.exceptions.request.RequestFailedException) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) ServerRequest(com.pokegoapi.main.ServerRequest) CheckAwardedBadgesResponse(POGOProtos.Networking.Responses.CheckAwardedBadgesResponseOuterClass.CheckAwardedBadgesResponse)

Aggregations

CheckAwardedBadgesMessage (POGOProtos.Networking.Requests.Messages.CheckAwardedBadgesMessageOuterClass.CheckAwardedBadgesMessage)1 CheckAwardedBadgesResponse (POGOProtos.Networking.Responses.CheckAwardedBadgesResponseOuterClass.CheckAwardedBadgesResponse)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 RequestFailedException (com.pokegoapi.exceptions.request.RequestFailedException)1 ServerRequest (com.pokegoapi.main.ServerRequest)1