use of POGOProtos.Networking.Requests.Messages.GetHoloInventoryMessageOuterClass.GetHoloInventoryMessage in project PokeGOAPI-Java by Grover-c13.
the class Inventories method updateInventories.
/**
* Updates the inventories with the latest data.
*
* @param forceUpdate For a full update if true
* @return the response to the update message
* @throws RequestFailedException if an exception occurred while sending requests
* @deprecated Inventory is updated as a common request
*/
@Deprecated
public GetHoloInventoryResponse updateInventories(boolean forceUpdate) throws RequestFailedException {
if (forceUpdate) {
lastInventoryUpdate = 0;
itemBag.reset();
pokebank.reset();
candyjar.reset();
pokedex.reset();
synchronized (this.lock) {
incubators.clear();
}
hatchery.reset();
}
GetHoloInventoryMessage invReqMsg = GetHoloInventoryMessage.newBuilder().setLastTimestampMs(lastInventoryUpdate).build();
ServerRequest inventoryRequest = new ServerRequest(RequestType.GET_HOLOHOLO_INVENTORY, invReqMsg);
api.requestHandler.sendServerRequests(inventoryRequest, false);
GetHoloInventoryResponse response;
try {
response = GetHoloInventoryResponse.parseFrom(inventoryRequest.getData());
} catch (InvalidProtocolBufferException e) {
throw new RequestFailedException(e);
}
return response;
}
use of POGOProtos.Networking.Requests.Messages.GetHoloInventoryMessageOuterClass.GetHoloInventoryMessage in project PokeGOAPI-Java by Grover-c13.
the class CommonRequests method getInventory.
/**
* Creates a default GET_INVENTORY request
*
* @param api the current api
* @return the constructed request
*/
public static ServerRequest getInventory(PokemonGo api) {
long lastUpdate = api.inventories.lastInventoryUpdate;
GetHoloInventoryMessage message = GetHoloInventoryMessage.newBuilder().setLastTimestampMs(lastUpdate).build();
return new ServerRequest(RequestType.GET_HOLOHOLO_INVENTORY, message);
}
Aggregations