Search in sources :

Example 1 with MarkTutorialCompleteMessage

use of POGOProtos.Networking.Requests.Messages.MarkTutorialCompleteMessageOuterClass.MarkTutorialCompleteMessage in project PokeGOAPI-Java by Grover-c13.

the class PlayerProfile method markTutorial.

private void markTutorial(TutorialStateOuterClass.TutorialState state) throws RequestFailedException {
    final MarkTutorialCompleteMessage tutorialMessage = MarkTutorialCompleteMessage.newBuilder().addTutorialsCompleted(state).setSendMarketingEmails(false).setSendPushNotifications(false).build();
    ServerRequest request = new ServerRequest(RequestType.MARK_TUTORIAL_COMPLETE, tutorialMessage);
    api.getRequestHandler().sendServerRequests(request);
    try {
        playerData = MarkTutorialCompleteResponse.parseFrom(request.getData()).getPlayerData();
        updateProfile(playerData);
    } catch (InvalidProtocolBufferException e) {
        throw new RequestFailedException(e);
    }
}
Also used : RequestFailedException(com.pokegoapi.exceptions.request.RequestFailedException) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) MarkTutorialCompleteMessage(POGOProtos.Networking.Requests.Messages.MarkTutorialCompleteMessageOuterClass.MarkTutorialCompleteMessage) ServerRequest(com.pokegoapi.main.ServerRequest)

Aggregations

MarkTutorialCompleteMessage (POGOProtos.Networking.Requests.Messages.MarkTutorialCompleteMessageOuterClass.MarkTutorialCompleteMessage)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 RequestFailedException (com.pokegoapi.exceptions.request.RequestFailedException)1 ServerRequest (com.pokegoapi.main.ServerRequest)1