TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

Request: Bantime on ClientLeaveEvent

Open marcschuler opened this issue 6 years ago • 1 comments

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}

marcschuler avatar Feb 10 '19 16:02 marcschuler

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!

rogermb avatar Feb 11 '19 16:02 rogermb