use of POGOProtos.Networking.Requests.Messages.GymGetInfoMessageOuterClass.GymGetInfoMessage in project PokeGOAPI-Java by Grover-c13.
the class Gym method details.
private GymGetInfoResponse details() throws RequestFailedException {
List<TutorialState> tutorialStates = api.playerProfile.getTutorialState().getTutorialStates();
if (!tutorialStates.contains(TutorialState.GYM_TUTORIAL)) {
api.playerProfile.visitGymComplete();
}
if (details == null) {
GymGetInfoMessage reqMsg = GymGetInfoMessage.newBuilder().setGymId(this.getId()).setGymLatDegrees(this.getLatitude()).setGymLngDegrees(this.getLongitude()).setPlayerLatDegrees(api.latitude).setPlayerLngDegrees(api.longitude).build();
ServerRequest serverRequest = new ServerRequest(RequestType.GYM_GET_INFO, reqMsg);
api.requestHandler.sendServerRequests(serverRequest, true);
try {
details = GymGetInfoResponse.parseFrom(serverRequest.getData());
} catch (InvalidProtocolBufferException e) {
throw new RequestFailedException();
}
}
return details;
}
Aggregations