Code Monkey home page Code Monkey logo

pokegoapi-java's Issues

getFortDetails

Hello,

why getFortDetails get 2 long as params, and then cast to double?

shouldn't be 2 double?

NoHttpResponseException

I just tried this example:

auth = new GoogleLogin().login("username","password");
PokemonGo go = new PokemonGo(auth);
System.out.println(go.getPlayerProfile());

The authentications seems to work but i always end up with this exception:

org.apache.http.NoHttpResponseException: pgorelease.nianticlabs.com:443 failed to respond
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
    at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
    at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at com.pokegoapi.main.RequestHandler.sendRequests(RequestHandler.java:76)
    at com.pokegoapi.api.PokemonGo.getInventory(PokemonGo.java:64)
    at com.pokegoapi.api.PokemonGo.<init>(PokemonGo.java:35)
    at com.pokegoapi.api.Main.main(Main.java:13)

Error NoClassDefFound on Android

I'm trying to use these API on Android, I built the bundle, imported in the project and added compile files('libs/PokeGOAPI-Java_bundle-0.0.1-SNAPSHOT.jar') on gradle.build (I'm on Android studio).
I can correctly build my project and run it, but at runtime when I try to log in (both with PTC and Google) the app crashes.
Here's the log:

java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: LPOGOProtos/Networking/EnvelopesOuterClass$Envelopes$RequestEnvelope$AuthInfo; at com.pokegoapi.auth.GoogleLogin.login(GoogleLogin.java:78) at com.acatch.pompomon.pokemon.MainActivity$Login.doInBackground(MainActivity.java:98) at com.acatch.pompomon.pokemon.MainActivity$Login.doInBackground(MainActivity.java:56) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:818)  Caused by: java.lang.ClassNotFoundException: Didn't find class "POGOProtos.Networking.EnvelopesOuterClass$Envelopes$RequestEnvelope$AuthInfo" on path: DexPathList[[zip file "/data/app/com.acatch.pompomon.pokemon-2/base.apk"],nativeLibraryDirectories=[/data/app/com.acatch.pompomon.pokemon-2/lib/arm, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at com.pokegoapi.auth.GoogleLogin.login(GoogleLogin.java:78)  at com.acatch.pompomon.pokemon.MainActivity$Login.doInBackground(MainActivity.java:98)  at com.acatch.pompomon.pokemon.MainActivity$Login.doInBackground(MainActivity.java:56)  at android.os.AsyncTask$2.call(AsyncTask.java:295)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:818)  Suppressed: java.lang.NoClassDefFoundError: POGOProtos.Networking.EnvelopesOuterClass$Envelopes$RequestEnvelope$AuthInfo at dalvik.system.DexFile.defineClassNative(Native Method) at dalvik.system.DexFile.defineClass(DexFile.java:226) at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219) at dalvik.system.DexPathList.findClass(DexPathList.java:338) at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54) ... 11 more Suppressed: java.lang.ClassNotFoundException: POGOProtos.Networking.EnvelopesOuterClass$Envelopes$RequestEnvelope$AuthInfo at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 10 more Caused by: java.lang.NoClassDefFoundError: > > Class not found using the boot class loader; no stack trace available

So it seems it cannot find anything of POGO library (at runtime, at build time everything is fine).
I'm not sure but searching around seems like it could something related to DeX: http://stackoverflow.com/questions/28283688/noclassdeffounderror-for-jar-library-at-runtime-in-android-studio but I don't know which modules are defined as Application (I guess there aren't).

So, any idea?
And keep up the good work, if I'll find some time I'll contribute too

Does Login Work ATM?

I first tried with GoogleLogin but the request failed and got an exception.
Then I tried PTCLogin and again got a LoginFailedException.

I also tried again with the sample code and again got the same exception?

Gracefully retry requests

Instead of having these big try/catch blocks (and then returning null data), I think the API should not just dump the stacktrace to the console, but either automatically retry after some time, or return that it failed and should be retried later.

Persisting Auth info

There is currently no way to persist auth info. This is useful for apps where a user will login and then use and exit the app, as the next time they open the app their auth info can be retrieved from disk instead of requiring them to log in again.

Nearby pokemons all at 200 meters ?

Trying the API and when I check the nearByPokemon it always says they are 200 meters away. Which is wrong as I can clearly a catchable poker just next to me.

Is this a bug of the server or the API ?

Implementation in Android, "real case" use?

Hey,

is there someone already trying to get this working on Android Studio or on android in general? With an demo app maybe. Just for confirmation and may get attention to this a bit more.

Legal Issues, thoughts?

Here are some of the legal terms that could be related to the API, thoughts?

(iii) Use, or facilitate the use of, any unauthorized third-party software (e.g. bots, mods, hacks, and scripts) to modify or automate operation within the Service whether for yourself or for a third party.
(v) Download quantities of content to a database for any reason;
(vi) Decompose, disassemble, or reverse engineer any part of any Service, or otherwise use a Service for any purpose other than those provided for by us and in conjunction with the operations of the Service;
(vii) Develop functionally similar products or services to any Service;
(xiii) Attempt to circumvent any restriction in any Service based upon age, geography, or other restriction imposed by us.

Source: http://www.pokemon.com/us/terms-of-use/

com.pokegoapi.main.Request 404 Not found

Has you can read, someone deleted it, its gonna be easier if someone can re-push it again ;)
PS : gonna submit a PR to add how to build/install the api to the readme, might push it with it.

Wild Pokemons

I can get neaby gyms and pokestops but there is a issue with wild pokemons do you guys aware of that ?

Logging

Should have logging through the API (esp for raw requests / responses) for easier debugging.

Thoughts?

java.lang.NoClassDefFoundError

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder
at com.pokegoapi.auth.PTCLogin.login(PTCLogin.java:160)

java.lang.NoClassDefFoundError

I got this error when try to run the API in Android Studio:
java.lang.NoClassDefFoundError: okhttp3.internal.tls.OkHostnameVerifier
in the line
OkHttpClient httpClient = new OkHttpClient();

In my gradle i import the corrects dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.github.Grover-c13:PokeGOAPI-Java:master-SNAPSHOT'
}

And in my other gradle:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

I spend like 4 hours finding a solution and came up with nothing, so i ask you for help.

No Readme or example

Hello,
could you please provide some example how to run your API? Im happy that someone is developing JAVA code for the API and I wont need to use python which Im unable to make working for missing libs. But it would be good to have some README or tutorial with example class to see how I can make it running.
Thank you

ProfileRequest: Wrong RPC ID

I was having trouble retrieving the profile data and only got it to work after changing Communication.Method.GET_PLAYER_PROFILE to Communication.Method.GET_PLAYER.

I also had to change the fields from required to optional in inventory.proto under PlayerStatsProto and recompile the .java files with protoc.

Service Unavailable

Hi when invoke login i receive this response, when call new PtcLogin(http).login

Response{protocol=http/1.1, code=503, message=Service Unavailable, url=https://sso.pokemon.com/503?locale=null}

There are problem with services ?
The username and password that i must provide is of my google account ?

Pokemon Proto

Java is not reading in the proto properly, all fields except one are fine (the important one too :|), the main ID for that pokemon. Its appearing as unrecognized field 1.

If anyone has any ideas, please let me know

Pokemon {
  PokemonId: 41
  Cp: 10
  Stamina: 10
  MaxStamina: 10
  Move1: 202
  Move2: 50
  HeightM: 0.7697427
  WeightKg: 6.7737203
  IndividualAttack: 12
  IndividualDefense: 1
  IndividualStamina: 9
  CpMultiplier: 0.094
  Pokeball: 1
  CapturedS2CellId: 3040700506126155776
  CreationTimeMs: 1468583377444
  FromFort: true
  1: 0x455da2ba068ba149
}

CatchablePokemons isn't working for me.

For some reason the size of CatchablePokemons is 0.

Collection<MapPokemonOuterClass.MapPokemon> catchablePokemons = this.api.getMap()
                    .getMapObjects(51.86177, 4.526361)
                    .getCatchablePokemons();

It worked fine before, but since I updated the API it's always an empty collection.

If I login on my phone, there are pokemon near that coordinate.

getMapObjects doesn't return all objects (pokestop)

it's correct to do

while (true) {
go.setLocation(lat, long, h);
go.getMap().getMapObjects(1);
lat+=SOMETHING;
long+=SOMETHING;
}

i am not getting all the results from getPokestops, and i am sure of that cos i am testing on the same area :)

JavaDocs

Need to add JavaDoc annotations/commets for all public exposed methods (and preferably all methods :P),
and host them somewhere.

License

What is this api licensed under? I'd like to use it but I need to know what all I can do with it first (e.g. commercial/noncommercial, etc.). I only ask because I couldn't find a License file or any other license notes anywhere. Thanks!

Fix namespaces

Right now, when you include this in another project, you need to have these imports

import auth.GoogleLogin;
import api.PokemonGo;

I think it would be better to put everything in a correct namespace so you can easily see what you have imported in other projects (instead of the names above).

checkpoint checkin

Hello,

i am having trouble on understanding how i can checkin on a particular checkpoint that i found on map.

can someone point me on the right direction?

Also, there is a place with docs, like a wiki or such?

MapObjectCells

Is there any specific setting for the map cells? I'm using http://s2map.com to get cell ids, but i always get a "missedCells" response with all my requested cells back. Or am i missing something?

exception while go.getPlayerProfile(true)

while doing go.getPlayerProfile(true) (after begin logged)

it throw this excepiton

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at com.pokegoapi.main.RequestHandler.sendServerRequests(RequestHandler.java:119)
    at com.pokegoapi.api.PokemonGo.getPlayerAndUpdateInventory(PokemonGo.java:101)
    at com.pokegoapi.api.PokemonGo.getPlayerProfile(PokemonGo.java:154)


it's even possible that's correct, but will be better imho if it throw something more understandable or a custom exception?

PlayerStatsProto issues

except the first 4 fields are required
the rest should be all optional.

for example, if a player never entered any gym. His response of NumBattleAttackWon NumBattleAttackTotal etc does not exist. I have tested and confirmed.

The API prints stacktraces, instead of throwing errors

An API should always throw the exception to the user, instead of just printing a stack and ignoring it.

Example:

        try {
            go = new PokemonGo(auth, http);
        } catch(Exception ex) {
            Logger.error("Servers appear to be down");
            ex.printStackTrace();
            System.exit(1);
        }

Won't do shit, because you only print the stack, which makes it impossible for the API user to handle errors while the servers are down...

unable to catch pokemon

After moving to the suggested api, i am unable to catch pokemon.

can someone explain the difference between
MapPokemon
and
WildPokemon

tnx

protocol buffer dependency

I added pokegoapi as a maven dependency using jitpack, but it wouldn't work until I explicitly added the protocol buffer dependency to my project as well.

Not sure how to fix it or I would do a PR

UnmodifiableCollection.addAll error when getting MapObjects

Stacktrace:
java.lang.UnsupportedOperationException
W/System.err: at java.util.Collections$UnmodifiableCollection.addAll(Collections.java:932)
W/System.err: at com.pokegoapi.api.map.MapObjects.addDecimatedSpawnPoints(MapObjects.java:54)
W/System.err: at com.pokegoapi.api.map.Map.getMapObjects(Map.java:127)
W/System.err: at com.pokegoapi.api.map.Map.getMapObjects(Map.java:86)
W/System.err: at com.pokegoapi.api.map.Map.getMapObjects(Map.java:74)
W/System.err: at com.pokegoapi.api.map.Map.getMapObjects(Map.java:43)

Occurs when calling PokemonGo.getMap().getMapObjects(lat, long)

Exception: Attempt to invoke virtual method 'com.google.protobuf.CodedInputStream com.google.protobuf.ByteString.newCodedInput()' on a null object reference

This just started in the last 24 hours with some updates to the repo and POGOProtos.

Running the following:
EnvelopesOuterClass.Envelopes.RequestEnvelope.AuthInfo auth = new PTCLogin(client).login(username, password); Log.d(LOG_TAG, auth.toString()); PokemonGoApi = new PokemonGo(auth, client);

Yields this:

java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.protobuf.CodedInputStream com.google.protobuf.ByteString.newCodedInput()' on a null object reference
System.err:     at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:104)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:125)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:130)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
System.err:     at POGOProtos.Networking.Responses.GetPlayerResponseOuterClass$GetPlayerResponse.parseFrom(GetPlayerResponseOuterClass.java:230)
System.err:     at com.pokegoapi.api.PokemonGo.getLocalPlayer(PokemonGo.java:72)
System.err:     at com.pokegoapi.api.PokemonGo.getPlayerProfile(PokemonGo.java:89)
System.err:     at com.pokegoapi.api.PokemonGo.<init>(PokemonGo.java:53)
System.err:     at Application.loginTest(Application.java:32)

Sometimes it is yielding this exception as well:

com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.

Apologies if this is just simply that their API has changed over night.

I am almost ready to push to here a fully working Android version but I need to get this resolved.

suggestion: better handling exceptions

Right now, as we know, pokemon go server are.. well.. disappointing 💃

while login, as opened on prev ticket we can now see

E/PokemonGo: Failed to get profile data and update inventory
com.pokegoapi.exceptions.RemoteServerException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null

that's a e.printStackTrace.

can i suggest to remove all the printStackTrace and replace them with throw new Throwable(something) or even better throw new CustomException, like ServerKaput!

it's useful for custom error handling & logging purpose

spawnPoints / decimatedSpawnPoints

Just for clarification:
I assume spawnpoints are the coordinates where it is possible that pokemons spawn, am i right? What's the difference between spawnPoints and decimatedSpawnPoints?

compile error for new pull

the new CatchablePokemon.java have some issue that block compile.

[ant:checkstyle] [WARN] /Users/rama/Dropbox/test/PokeGOAPI-Java/src/main/java/com/pokegoapi/api/map/pokemon/CatchablePokemon.java:123: First sentence of Javadoc is incomplete (period is missing) or not present. [SummaryJavadoc]
[ant:checkstyle] [WARN] /Users/rama/Dropbox/test/PokeGOAPI-Java/src/main/java/com/pokegoapi/api/map/pokemon/CatchablePokemon.java:132: 'if' construct must use '{}'s. [NeedBraces]
[ant:checkstyle] [WARN] /Users/rama/Dropbox/test/PokeGOAPI-Java/src/main/java/com/pokegoapi/api/map/pokemon/CatchablePokemon.java:133: 'if' construct must use '{}'s. [NeedBraces]
[ant:checkstyle] [WARN] /Users/rama/Dropbox/test/PokeGOAPI-Java/src/main/java/com/pokegoapi/api/map/pokemon/CatchablePokemon.java:134: 'if' construct must use '{}'s. [NeedBraces]
:checkstyleMain FAILED
FAILURE: Build failed with an exception.

com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null

Yesterday my code worked like a charm..
Now its throwing this exception at me like crazy, maybe the developer of pokemonGo changed something that we need to adapt to?

com.pokegoapi.exceptions.RemoteServerException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null
at com.pokegoapi.api.map.Map.getMapObjects(Map.java:171)
at com.pokegoapi.api.map.Map.getMapObjects(Map.java:143)
at com.pokegoapi.api.map.Map.getMapObjects(Map.java:89)
at com.pokegoapi.api.map.Map.getMapObjects(Map.java:79)
at com.pokegoapi.api.map.Map.getRetainedMapObject(Map.java:50)
at com.pokegoapi.api.map.Map.getCatchablePokemon(Map.java:63)
at de.busybeever.pokemongo.pokemonfinder.PokemonFinder$1.run(PokemonFinder.java:44)
at java.lang.Thread.run(Unknown Source)
//This is my line 44 in PokemonFinder
List li = pokemonGo.getMap().getCatchablePokemon();

item interaction

Hello,

how can i drop items on my bag?

this one seems the most probable

go.getBag().removeItem(X,1)

but it doesn't work as expected (i try to remove all pokeballs and leave 100)

Imitate official app behaviour

The official app often does requests like this

+ GetHatchedEggs, GetInventory, CheckAwardedBadges, DownloadSettings

Should we replicate this in the API or should be let users of the API do this per application?

Also, the official app requests map objects every 1-5(? correct number is in the reply of DownloadSettings afaik) seconds, replicate this in the API or let others figure this out?

Pokemon Data From Encounter Result

Is there any way to add a method to EncounterResult where it returns the pokemon information (WildPokemon and CaptureProbability) so it's possible to judge what to do before trying to catch it?

Ex: Get the CP from the pokemon so it's possible to use different balls to catch it?

Pokestops should support the Active Pokemon Attribute

Intro
The game offers a feature where you can buff a pokestop to lure pokemons. After you used a Module (the item which boosts a pokestop) Pokemons will show up on a regular. Modules are active for 30 minutes.

Tech
After you used a Module on a pokestop the pokestop will get a ActivePokemon Value. See a example below.

 {  
                    "fortId":"47b4a55ad8c54454940396aaf0601e02.16",
                     "lastModifiedMs":"1469000053563",
                     "latitude":45.030225,
                     "longitude":-93.318969,
                     "enabled":true,
                     "fortType":1,
                     "activePokemon":{  
                        "spawnpointId":"47b4a55ad8c54454940396aaf0601e02.16",
                        "encounterId":"2142514281",
                        "pokedexTypeId":"V0021_POKEMON_SPEAROW",
                        "expirationTimeMs":"1469001133514"
                     }
                  },
                  {  
                     "fortId":"5ec40620884740d98d6969e372156c5c.16",
                     "lastModifiedMs":"1468999658570",
                     "latitude":45.029967,
                     "longitude":-93.319217,
                     "enabled":true,
                     "fortType":1,
                     "activePokemon":{  
                        "spawnpointId":"5ec40620884740d98d6969e372156c5c.16",
                        "encounterId":"1178527421",
                        "pokedexTypeId":"V0013_POKEMON_WEEDLE",
                        "expirationTimeMs":"1469001098512"
                     }
                  },

this is something i found in the protobuf files

message PokemonFortProto {
    string FortId = 1;
    int64 LastModifiedMs = 2;
    double Latitude = 3;
    double Longitude = 4;
    int32 Team = 5;
    int32 GuardPokemonId = 6;
    int32 GuardPokemonLevel = 7;
    bool Enabled = 8;
    ENUM.Holoholo.Rpc.FortType FortType = 9;
    int64 GymPoints = 10;
    bool IsInBattle = 11;
    //unknown ActiveFortModifier = 12;
    Holoholo.Rpc.MapPokemonProto ActivePokemon = 13;
    int64 CooldownCompleteMs = 14;
    ENUM.Holoholo.Rpc.Sponsor.Types.FortSponsor.Sponsor Sponsor = 15;
    ENUM.Holoholo.Rpc.RenderingType.Types.FortRenderingType.RenderingType RenderingType = 16;
 }

catch pokemon doesn't work

Hello,

i have try this little piece of code to try to catch pokemon on my area.
distance return meters of distance from go.getLat/lon to pokemon.getLat/long with all
the supposed radiant sin cos stuff.

i check that the pokemon it's close to the current location, but catchResult return always fail.
on log i can see some json running around (probably a sleep will be better)

it's not working right now or i am doing something of wrong?

 Collection<CatchablePokemon> pokemons = go.getMap().getCatchablePokemon();
            for (CatchablePokemon pokemon : pokemons) {
                if (distance(go,pokemon) <0.5) {
                    for (int i = 0;i<10;i++) {
                        CatchResult r = pokemon.catchPokemon();
                        if (r.isFailed())
                        {
                            dbg("fail");
                        }
                    }
                }
            }

suggestion: catchPokemon with more options

Hi,

i see that catchPokemon support the ability to set certain pokeBall.

it will be great if you add the option for using the berry. Probably it's
already possible simply using the berry before using catchPokemon it's correct?

Also, another great options, will be (if necessary) to add the retry
feature for catchPokemon.

i think that CATCH_MISSED can be retryed, correct?
so, the correct 'flow' to catch a pokemon will be if result == CATCH_MISS catchPokemon();
or it's a final error?

so, my proposal, it's do add a method
catchPokemon(pokeBall,berryCt, retryCt)

that will use a custompokeball, a certain number of berries, and try for retryCt count.

don't see a license on the project

Guys is there a license on this project?
GPL/Apache/MIT ?
Having the license on the homepage would simplify things for people like me who are eager to play with this. :)
Cheers.

Getting the amount of candy of a PkMn ID

Are you planning on implementing this, or is it there and I'm missing it?

It would be very useful as in validating wether a Pokémon can evolve or not before requesting it to the server and to calculate the optimum amount of Pokémon to transfer (and then transfer them).

And congrats on the work so far!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.