Most of these happen due to errors, and none of them are defined.
Examples:
"Already logged in."
"User is already ignored."
and even stuff like
"The HASH command is no longer supported."
Some of these are actual user errors, but some are lobby client errors. In any case it's hard to handle and properly present them to the user as they're never defined! Also, I'm not sure if there's any reference as to what command (not just type, but also id) caused it. Lastly, these messages cannot be easily displayed in other languages.
(it's doable, but really ugly)
Code: Select all
if msg == 'The HASH command is no longer supported.' then return i18n("hash-unsupported") end
This is not ideal.
So I propose the following: use return codes instead.
These could be just simple integers, and we could have a list of meanings of each integer, or they could be variable-like strings, e.g. "too-many-attempts". In either case, they should all be defined by the protocol.
Also, all errors should also contain the id of the command if it was passed.
It's possible to send commands like this to uberserver:
#1 IGNORE xyz
To which a response could be
#1 ERROR 3 -> in this case, code 3 could represent 'No such user' for the IGNORE command.
(Maybe we should have a single ERROR command, or multiple $COMMAND$ERROR commands, not yet decided).