Comments (4)
Same here.
from pokemongo-api-demo.
same problem
from pokemongo-api-demo.
Yep! Get it too.
from pokemongo-api-demo.
Here is the current Heartbeat code:
def raw_heartbeat(api_endpoint, access_token, response):
m4 = pokemon_pb2.RequestEnvelop.Requests()
m = pokemon_pb2.RequestEnvelop.MessageSingleInt()
m.f1 = int(time.time() * 1000)
m4.message = m.SerializeToString()
m5 = pokemon_pb2.RequestEnvelop.Requests()
m = pokemon_pb2.RequestEnvelop.MessageSingleString()
m.bytes = "05daf51635c82611d1aac95c0b051d3ec088a930"
m5.message = m.SerializeToString()
walk = sorted(getNeighbors())
m1 = pokemon_pb2.RequestEnvelop.Requests()
m1.type = 106
m = pokemon_pb2.RequestEnvelop.MessageQuad()
m.f1 = ''.join(map(encode, walk))
m.f2 = "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
m.lat = COORDS_LATITUDE
m.long = COORDS_LONGITUDE
m1.message = m.SerializeToString()
response = get_profile(
access_token,
api_endpoint,
response.unknown7,
m1,
pokemon_pb2.RequestEnvelop.Requests(),
m4,
pokemon_pb2.RequestEnvelop.Requests(),
m5)
payload = response.payload[0]
heartbeat = pokemon_pb2.ResponseEnvelop.HeartbeatPayload()
heartbeat.ParseFromString(payload)
return heartbeat
def heartbeat(api_endpoint, access_token, response):
while True:
try:
h = raw_heartbeat(api_endpoint, access_token, response)
return h
except Exception, e:
if DEBUG:
print(e)
print('[-] Heartbeat missed, retrying')
Step 1 is to figure out why the heartbeat fails (raw_heartbeat). Is the PGO server ending sessions that aren't active (moving around)? If so, you could add a minor walking distance to the script so that the location moves around. If there isn't a way to find out what's causing the session to timeout or if the cause is not something that can be fixed, consider adding a quick attempts clause to heartbeat so that it restarts the necessary portions of the script (like login?), no need to have the whole damn thing restart! Something along these lines, I'm guessing:
Attempts = 0
while attempts < 3:
try:
#heartbeat_raw code
except Exception, e:
if DEBUG:
attempts += 1
print(e)
print('[-] Heartbeat missed, retrying')
break
while attempts = 3:
#create new session
attempts == 0
from pokemongo-api-demo.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pokemongo-api-demo.