thomas-crane / famebot

A bot for Realm of the Mad God designed to automate the process of collecting fame.
MIT License
19 stars 12 forks source link

Reconnect to realm would reconnect to any realm, despite it not being the optimal one #15

Closed Azukee closed 7 years ago

Azukee commented 7 years ago

In commit ebe44816666f5ec28a8c2850ecffccda81c763bd the added realm reconnect would ignore the optimal realm and reconnect to the realm it was in before either way.

I'm assuming this originates from if (client.State.LastRealm?.Name.Contains(bestName) ?? false) and would work better if changed to if (client.State.LastRealm?.Name == "NexusPortal." + bestName) although I haven't tested this fix yet, this should work fine.

Edit: also as seen here: https://azuki.s-ul.eu/s5CCXcsZ I would also set the variable bestName in the else from the first if-statement

thomas-crane commented 7 years ago

Hopefully fixed. See commit ceba5607ae2289fc6bf97d01aabb684ca48edf8b for details.