Also, (if and) while you're going about implementing that, you could also spice up world/IsBanned() a bit. I leave you the thinking.
Yeah well, I do have some things in mind. :P
- Maybe it could include additional useful info in its arguments that is unavailable in the phase of IsBanned()-callage, such as the connecting player's BYOND version (this would alternatively let you if the player connected from telnet), gender, OS, and maybe as a complement or shout-off to control_freak, if that player is using a custom (or altered) interface of the world (this is already available in the mentioned var, but you could for example discriminate and do this dynamically in this way, by allowing 'kool' people like staff and the owner custom skins but not the other players), and maybe even if that player is using some altered snazzy DMS scripts or something, or a DMS script from the BYOND site (ok, I ran out of things to list).
This would conveniently grant you the ability to, for example, quickly ban all females, or all *nix users. xD Joking of course... so maybe it wouldn't be as useful for rational people (other than the byond_version), but for the sake of completion perhaps? (but one may still do want to ban all neuters, for instance) - Could the result of IsBanned() be somehow forwarded on to client/New() if the player is granted connection, so it can be known without calling IsBanned() again? I cite this from the Reference as the clarification:
[...] Tom was banned through some other means, and he has been allowed to login, even though he is banned. (Code in client/New() might then check IsBanned() and somehow limit his activities in the game.)
This is potentially a pretty good idea, but you can't actually do this without manually re-calling IsBanned() with the right arguments for the player (which is kinda silly), or other methods consisting of more-roundabout-than-it-should-be silliness. If possible, client/New() should have an argument that is in practice what IsBanned() returned for that player (which could be a list with a bunch of info, or just a value like 0). Or if this is tricky for some reason, then at least a flag that is set to one value if the "Login" = 1 parameter was set (to allow a banned player to login), and to another if it was set because of a pager-ban, for completeness.
Thank you for reading kind sir, and have a great day.
Disclaimer: I wrote this up at 4 AM. This is without sleeping of course, since I'm a kool guy.
6. A parameter in IsBanned() or in its returned params that stops it from logging when a player is denied access. IsBanned is more efficient to use than Login() since it prevents the downloading of resources, mob creation, etc. But, the spam it creates in the log file gets ridiculous.