Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static GetIncensePokemonResponse queryIncensePokemon() throws LoginFailedException, RemoteServerException {
- GetIncensePokemonMessageOuterClass.GetIncensePokemonMessage msg = GetIncensePokemonMessageOuterClass.GetIncensePokemonMessage.newBuilder().setPlayerLatitude(api.getLatitude()).setPlayerLongitude(api.getLongitude()).build();
- ServerRequest serverRequest = new ServerRequest(RequestTypeOuterClass.RequestType.GET_INCENSE_POKEMON, msg);
- api.getRequestHandler().sendServerRequests(serverRequest);
- GetIncensePokemonResponse response;
- try {
- response = GetIncensePokemonResponse.parseFrom(serverRequest.getData());
- } catch (InvalidProtocolBufferException e) {
- throw new RemoteServerException(e);
- }
- if (response.getResult() != GetIncensePokemonResponse.Result.INCENSE_ENCOUNTER_AVAILABLE) return null;
- return response;//this should return CatchablePokemon so you would have to modify API to add constructor for it etc
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement