@@ -95,32 +95,68 @@ public TS3ApiAsync(TS3Query query) {
9595 }
9696
9797 /**
98- * Adds a new ban entry. At least one of the parameters {@code ip}, {@code name} or {@code uid} needs to be not null.
99- * Returns the ID of the newly created ban.
98+ * Adds a new ban entry. At least one of the parameters {@code ip}, {@code name} or {@code uid} needs to be non- null.
99+ * Returns the ID of the newly created ban entry .
100100 *
101101 * @param ip
102- * a RegEx pattern to match a client's IP against, can be null
102+ * a RegEx pattern to match a client's IP against, can be {@code null}
103103 * @param name
104- * a RegEx pattern to match a client's name against, can be null
104+ * a RegEx pattern to match a client's name against, can be {@code null}
105105 * @param uid
106- * the unique identifier of a client, can be null
106+ * the unique identifier of a client, can be {@code null}
107107 * @param timeInSeconds
108108 * the duration of the ban in seconds. 0 equals a permanent ban
109109 * @param reason
110- * the reason for the ban, can be null
110+ * the reason for the ban, can be {@code null}
111111 *
112112 * @return the ID of the newly created ban entry
113113 *
114114 * @throws TS3CommandFailedException
115115 * if the execution of a command fails
116116 * @querycommands 1
117117 * @see Pattern RegEx Pattern
118+ * @see #addBan(String, String, String, String, long, String)
118119 * @see Client#getId()
119120 * @see Client#getUniqueIdentifier()
120121 * @see ClientInfo#getIp()
121122 */
122123 public CommandFuture <Integer > addBan (String ip , String name , String uid , long timeInSeconds , String reason ) {
123- Command cmd = BanCommands .banAdd (ip , name , uid , timeInSeconds , reason );
124+ return addBan (ip , name , uid , null , timeInSeconds , reason );
125+ }
126+
127+ /**
128+ * Adds a new ban entry. At least one of the parameters {@code ip}, {@code name}, {@code uid}, or
129+ * {@code myTSId} needs to be non-null. Returns the ID of the newly created ban entry.
130+ * <p>
131+ * Note that creating a ban entry for the {@code "empty"} "myTeamSpeak" ID will ban all clients who
132+ * don't have a linked "myTeamSpeak" account.
133+ * </p>
134+ *
135+ * @param ip
136+ * a RegEx pattern to match a client's IP against, can be {@code null}
137+ * @param name
138+ * a RegEx pattern to match a client's name against, can be {@code null}
139+ * @param uid
140+ * the unique identifier of a client, can be {@code null}
141+ * @param myTSId
142+ * the "myTeamSpeak" ID of a client, the string {@code "empty"}, or {@code null}
143+ * @param timeInSeconds
144+ * the duration of the ban in seconds. 0 equals a permanent ban
145+ * @param reason
146+ * the reason for the ban, can be {@code null}
147+ *
148+ * @return the ID of the newly created ban entry
149+ *
150+ * @throws TS3CommandFailedException
151+ * if the execution of a command fails
152+ * @querycommands 1
153+ * @see Pattern RegEx Pattern
154+ * @see Client#getId()
155+ * @see Client#getUniqueIdentifier()
156+ * @see ClientInfo#getIp()
157+ */
158+ public CommandFuture <Integer > addBan (String ip , String name , String uid , String myTSId , long timeInSeconds , String reason ) {
159+ Command cmd = BanCommands .banAdd (ip , name , uid , myTSId , timeInSeconds , reason );
124160 return executeAndReturnIntProperty (cmd , "banid" );
125161 }
126162
@@ -504,8 +540,9 @@ public void addTS3Listeners(TS3Listener... listeners) {
504540 /**
505541 * Bans a client with a given client ID for a given time.
506542 * <p>
507- * Please note that this will create two separate ban rules,
508- * one for the targeted client's IP address and their unique identifier.
543+ * Please note that this will create 2 or 3 separate ban rules,
544+ * one for the targeted client's IP address, one for their unique identifier,
545+ * and potentially one more for their "myTeamSpeak" ID.
509546 * </p><p>
510547 * <i>Exception:</i> If the banned client connects via a loopback address
511548 * (i.e. {@code 127.0.0.1} or {@code localhost}), no IP ban is created
@@ -517,7 +554,7 @@ public void addTS3Listeners(TS3Listener... listeners) {
517554 * @param timeInSeconds
518555 * the duration of the ban in seconds. 0 equals a permanent ban
519556 *
520- * @return an array containing the IDs of the first and the second ban entry
557+ * @return an array containing the IDs of the created ban entries
521558 *
522559 * @throws TS3CommandFailedException
523560 * if the execution of a command fails
0 commit comments