Advertisement
stirante

encounterPokemon

Aug 13th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. public EncounterResult encounterPokemon() throws LoginFailedException, RemoteServerException {
  2. IncenseEncounterMessageOuterClass.IncenseEncounterMessage msg = IncenseEncounterMessageOuterClass.IncenseEncounterMessage.newBuilder().setEncounterId(encounterId).setEncounterLocation(encounterLocation).build();
  3. ServerRequest serverRequest = new ServerRequest(
  4. RequestTypeOuterClass.RequestType.INCENSE_ENCOUNTER, msg);
  5. api.getRequestHandler().sendServerRequests(serverRequest);
  6. IncenseEncounterResponse response = null;
  7. try {
  8. response = IncenseEncounterResponse .parseFrom(serverRequest.getData());
  9. } catch (InvalidProtocolBufferException e) {
  10. throw new RemoteServerException(e);
  11. }
  12. encountered = response.getResult() == IncenseEncounterResponse.Result.INCENSE_ENCOUNTER_SUCCESS;
  13. return null;//here also should be new EncounterResult implementation for incense pokemon
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement