Request: Bantime on ClientLeaveEvent
When a client is banned (-> the reasonid is set to 6), the field bantime is present in the ClientLeaveEvent map and indicates for how long (in seconds) a client is banned.
One should add a method like "getBanTime()" to this class, returning the ban time as an integer (or can it be a long?) in seconds.
/** * * @return the ban time in seconds, 0 if indefinite or -1 if a client is banned (reasonId=6) */ public int getBanTime(){ return getInt("bantime"); }
Examples (ClientLeaveEvent.toString):
2 Seconds: {cfid=1, bantime=2, ctid=0, invokername=KarlTheBee, reasonmsg=test, reasonid=6, invokeruid=756VTuJBEftbJhTEJAIB4Q4cDR4=, invokerid=14, clid=4} indefinite: {cfid=1, bantime=0, ctid=0, invokername=KarlTheBee, reasonmsg=test, reasonid=6, invokeruid=756VTuJBEftbJhTEJAIB4Q4cDR4=, invokerid=14, clid=6}
I agree, this should be part of the API. I'll try to implement it for v1.3.0 😄
Thanks for the detailed enhancement proposal!