ALClient icon indicating copy to clipboard operation
ALClient copied to clipboard

Improve `bot.connect()` / `bot.disconnect()` / reconnecting in general

Open earthiverse opened this issue 3 years ago • 1 comments

Right now I create a new bot and discard the old bot, but there should be a way to fix it so that we can just recreate the socket and reconnect.

earthiverse avatar Sep 14 '22 23:09 earthiverse

From what I can see... The current process of connecting (within Character) is to call the connect function within Observer which creates the socket and adds several listeners, then passes control back to Character. Then, we add several more listeners before we actually connect. Within disconnect, we do the exact opposite; we remove all the listeners and then disconnect the socket.

Theoretically, we could simply add a reconnect function that calls disconnect and connect in sequence?

StormSurge95 avatar Oct 01 '22 14:10 StormSurge95