PoGo-Devs / PoGo

UWP Client for Pokemon Go
https://pogo-windows.com/
MIT License
38 stars 9 forks source link

API Client refactor #17

Closed robertmclaws closed 8 years ago

robertmclaws commented 8 years ago

NOTE: Still WIP.

review-ninja commented 8 years ago

ReviewNinja

robertmclaws commented 8 years ago

@WallyCZ, would love your opinion on how to refactor SetServer to be able to return the first set of data w/o needing a subsequent set of requests.

WallyCZ commented 8 years ago

Currently it seems that we don't need any SetServer method anymore, because it tries to simulate initial communication to server, but it's different anyway. Or at least it's implementation should be changed, communication starts with repeated single (not batched) GetPlayer until reply comes (delay between request is 0.5s).

ST-Apps commented 8 years ago

I didn't read all the code but SetServer is needed to set the first RPC uri when launching the app.

WallyCZ commented 8 years ago

Ok so we need it, but we have to change it :)

robertmclaws commented 8 years ago

SetServer does much more than that... it's called by DoLogin() to actually complete the Login request. It's sending GetPlayer, GetHatchedEggs, GetInventory, CheckAwardedBadges, and DownloadSettings, but not actually using any of that data. If we rewrite that code, we can actually use those results to eliminate duplicate calls.

ST-Apps commented 8 years ago

It's shaping up nice, well done. I'd say that this is also a good chance to simplify that Settings class. We don't need both PTC and Google username/password, we only need one username, password + auth type.

WallyCZ commented 8 years ago

It seems that last version 0.35 started to send at init phase GetPlayer and CheckChallenge (new feature) parallel and also CheckChallenge is added to batches (so now its 5 + 1 message in batch). We need strong mechanismus which will allow to control flow messages to match with original client.

ST-Apps commented 8 years ago

@WallyCZ let's continue in #20