Success.
----------
Date: Wednesday March 10 2010
Time:20:32:41
Admin: uristqwerty
>Ban reasoning here
>Ban reasoning there
>
>a
>
>fbv
>ag
>a
>ga
>erg
Everything is working perfectly!
It will only accept banned players/IPs, active players, and players who were unbanned, so that false names cannot be used as spam or anything similar.
It can only be read through notepad by the host, but I am sure someone will add an in-game reader, and even without it, it is still immensely useful.
Also suggested: log ban-based proc calls. So actual bans will show up alongside the admin ban comments.
Forgot-to-post-edit:
Added some security, and a proc to log ban events for other coders to call. It would be for logging things like bans and jobbans, not writing comments, as it doesn't prefix each line with >, except the first. (On the main ban log writer that line would be the admin: line, and the comment would follow. That way, comments can be distinguished from automated loggings.)
That proc also has the advantage of using the same timestamp format and general layout.
Example of it's use, would be placed at the start of the fullban proc(after the return on bad arguments line)
logBanEvent(M.ckey,"crban_fullban:\nBanner:[banner]\nReason[reason]")
Okay, final tests, and I am ready to share the code.
Okay, how is the format?
----------
Date: Wednesday March 10 2010
Time:20:58:17
Admin: uristqwerty
Comment:
>Ban reasoning here
----------
Date: Wednesday March 10 2010
Time:20:58:20
Admin: uristqwerty
Comment:
>Ban reasoning here
----------
Date: Wednesday March 10 2010
Time:20:58:24
Admin: uristqwerty
Comment:
>Ban reasoning here
One bug, but it is almost a feature: If you submit it by hitting enter with the focus outside of the reason box, the reason is left blank. This only coommonly occurs when an admin(me) writes the name last or
doesn't edit the reason. Since the only way to make that mistake would be to try to dismiss the box quickly, I'll leave it in as a feature.