ALClient
ALClient copied to clipboard
Improve `bot.connect()` / `bot.disconnect()` / reconnecting in general
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.
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?