Closed robertmclaws closed 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.
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?
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.
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.
Nice!
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.