Crabo in #bug-report (2024-06-10):
"(...) this will crash everyone in the map besides the bucc and 1 character, when a bucc (or TB) charges energy and a character with an ID that's a multiple of 102 is in the same map (and the energy reaches that number so if character ID is 204 it will reach that after 2 hits and DC the whole map besides the bucc and that char with id 204).
Thanks to others for helping me fix it. Thought I'd report it!"
setFalg() function is designed to take arguments of type short. Forcing the short type flag to be converted to the byte type causes some errors here.
For example, the equipment merge system will make the UNTRADEABLE flag become 520, combined with the Scissors of Karma 16, and finally become 536, this value is beyond the byte range, and the mandatory variable type will cause the flag error, the specific problem I encountered is that the MERGE_UNTRADEABLE flag is lost after using the Scissors of Karma.
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.