PoGo-Devs / PoGo

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

Tuples cleanup #16

Closed robertmclaws closed 8 years ago

robertmclaws commented 8 years ago
review-ninja commented 8 years ago

ReviewNinja

WallyCZ commented 8 years ago

Ad MapResponseContainer) It should have probably some base class, because there are more messages with HatchedEggsResponse , InventoryResponse, AwardedBadgesResponse, DownloadSettingsResponse. Basically (almost?) all requests have these four responses too.

robertmclaws commented 8 years ago

Ah, ok. So I think I have an idea about a fix. Question: Are the responses guaranteed to be in the same order as the requests? Every time?

WallyCZ commented 8 years ago

Currently it seems so, I have not found any message in different order from 100 messages (but it could be changed in future).

And one small thing: GetInventory everytime requires timestamp in request from last reply (without very first request) and DownloadSettings hash from last response to save bandwidth (new data are send only when changed). I don't know if it is useless for you but it shouldn't break this principle.

robertmclaws commented 8 years ago

I'll rely on you to construct the other requests properly.

OK, so I changed the MapResponseContainer to just be ResponseContainer, and I made the first property generic. That should make it super-straightforward. At the GameServices level, we'll just run each response through a helper that will fire off the update events after the main response is processed.

WallyCZ commented 8 years ago

Nice!

robertmclaws commented 8 years ago

Question: On Login.SetServer(), should that be returning the payload that we're requesting on Lines 66-87? Seems like that would be saving a request and getting the app up to speed a LOT more quickly.