Closed robertmclaws closed 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.
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).
I didn't read all the code but SetServer
is needed to set the first RPC uri when launching the app.
Ok so we need it, but we have to change it :)
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.
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.
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.
@WallyCZ let's continue in #20
NOTE: Still WIP.