Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IncenseTest {
- public static PokemonGo api;
- public static UseIncenseResponseOuterClass.UseIncenseResponse useIncense(ItemIdOuterClass.ItemId type) throws RemoteServerException, LoginFailedException {
- UseIncenseMessageOuterClass.UseIncenseMessage msg = UseIncenseMessageOuterClass.UseIncenseMessage.newBuilder().setIncenseType(type).build();
- ServerRequest serverRequest = new ServerRequest(RequestTypeOuterClass.RequestType.USE_INCENSE, msg);
- api.getRequestHandler().sendServerRequests(serverRequest);
- UseIncenseResponseOuterClass.UseIncenseResponse response;
- try {
- response = UseIncenseResponseOuterClass.UseIncenseResponse.parseFrom(serverRequest.getData());
- } catch (InvalidProtocolBufferException e) {
- throw new RemoteServerException(e);
- }
- return response;
- }
- public static CatchablePokemon 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);
- }
- return new CatchablePokemon(api, response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement