Pokemon-GO-node-api icon indicating copy to clipboard operation
Pokemon-GO-node-api copied to clipboard

Errors on Examples

Open syrys opened this issue 9 years ago • 2 comments

Hey guys,

Tried to run the examples, and im getting errors on MOST of them. So, lets go one at a time. I tried the examples with default location with my login info.

it crashes like this (ill remove some sensitive info) ExampleFort

<MY_DIR>\Pokemon-GO-node-api>node exampleFort.js
[i] Logging with user: <MY_USER>
[i] Session token: <MY_USER_TOKEN>
[i] Received PTC access token! {Expires: 10800}
[i] Received API Endpoint: https://pgorelease.nianticlabs.com/plfe/352/rpc
[i] Current location: Time Square
[i] lat/long/alt: : 42.4907071 -76.2979782 0
[i] Logged in!
[i] Username: <MY_USER>
[i] Poke Storage: 250
[i] Item Storage: 350
[i] Pokecoin: 0
[i] Stardust: 100
[o] pump...
.:Fort is a gym, pass:.
{ result: 2,
  items_awarded: [],
  gems_awarded: null,
  pokemon_data_egg: null,
  experience_awarded: null,
  cooldown_complete_timestamp_ms: null,
  chain_hack_sequence_number: null }
{ result: 2,
  items_awarded: [],
  gems_awarded: null,
  pokemon_data_egg: null,
  experience_awarded: null,
  cooldown_complete_timestamp_ms: null,
  chain_hack_sequence_number: null }
<MY_DIR>\Pokemon-GO-node-api\example
Fort.js:68

                if(b.result === 2) {

                    ^

TypeError: Cannot read property 'result' of undefined
    at <MY_DIR>\Pokemon-GO-node-api\exampleFort.js:68:16
    at <MY_DIR>\Pokemon-GO-node-api\poke.io.js:527:24
    at Request._callback (<MY_DIR>\Pokemon-GO-node-api\poke.io.js:188:18)
    at Request.self.callback (<MY_DIR>\Pokemon-GO-node-api\node_modules\request\request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (<MY_DIR>\Pokemon-GO-node-api\node_modules\request\request.js:1044:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (<MY_DIR>\Pokemon-GO-node-api\node_modules\request\request.js:965:12)

when i run the example.js, i get this:

Encountering pokemon Pidgey...
Attempting to catch now...
<MY_DIR>\Pokemon-GO-node-api\node_modu
les\protobufjs\dist\protobuf.js:2938
                        throw(e);
                        ^

Error: Missing at least one required field for Message .ResponseEnvelop
.CatchPokemonResponse: Status

examplestats:

<MY_DIR>\Pokemon-GO-node-api\node_modu
les\bytebuffer\dist\bytebuffer-node.js:346
            throw TypeError("Illegal buffer");
            ^

TypeError: Illegal buffer

Any ideas?

syrys avatar Aug 09 '16 08:08 syrys

Was going to mention this before - for b.resulterror, the heartbeat failed to return. There needs to be a check for null or undefined. Will submit PR unless I'm beaten to it.

With the use of promises, this is not an issue. Using Pokego will prevent the undefined errors.

As for the other 2, not sure

ButchMonkey avatar Aug 09 '16 15:08 ButchMonkey

Pokego still needs the new auth update for unknown6

d-pollard avatar Aug 10 '16 15:08 d-pollard