Problem: disconnecting requires access to CharacterSaver,
which is not available in Client.
Having it in a service like this solves that problem.
Next step is to migrate all calls to Client#disconnect and Client#forceDisconnect
to their TransitionService counterparts.
canRequestCharlist is a relic from the past when "View all char"
functionality was hacked together with wrong packets.
visibleWorlds I'm less sure about. I suppose it's useful if you add world
(via command) while someone is still on the login screen.
But the functionality of adding/removing worlds live is a recipe for disaster
and will eventually (likely) be removed.
This makes it easier to add checks in handlers, which should improve security over time.
I think this approach is more readable and testable than calling Client#disconnect straight up,
while it also decentralizes the handling.
This commit emphasizes the need for events to be reworked.
This is the chain of constructors the DropProvider has to pass through to reach MapleMap:
Channel -> EventScriptManager -> EventManager -> EventInstanceManager -> MapManager -> MapleMap
Preparing for change in Command#handle,
which is going to take a CommandContext as an additional argument.
This way we can pass in command dependencies in a safe way
instead of requiring them to access static methods.
NoteService should be the only class with access to NoteDao;
nowhere else should NoteDao be accessed directly.
Channel dependencies are static in PacketProcessor, for now.
Ideally they would be injected in the constructor,
but since the constructor is private and I don't want to open
up that can of worms, I'll leave it like this.
At the very least, now we have a way of injecting services into
the handlers. This will make further restructuring way easier.