Ishadijcks / MooLite

Open source Milky Way Idle client
11 stars 4 forks source link

Resubscribe to MooSocket after disconnection #148

Closed seashairo closed 7 months ago

seashairo commented 7 months ago

Overview

https://github.com/Ishadijcks/MooLite/issues/86

If MWI drops it's WebSocket connection (e.g. by server restart or by calling gameWebsocket.closeConnection()) then it will create a new socket instead of reopening the old one. This obviously then causes MooLite to stop working as intended because we no longer receive any server updates.

When this change is applied, we will check if the MooLite socket is still the same as the socket that MWI is using, and if it's not then we'll reconnect and resubscribe. The check is happening in the tick handler so it shouldn't be a big performance impact.

Testing instructions