File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
src/main/java/com/github/theholywaffle/teamspeak3/commands Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 28
28
29
29
import com .github .theholywaffle .teamspeak3 .commands .parameter .KeyValueParam ;
30
30
31
+ /**
32
+ * Command to look up the value of a permission for the server query.
33
+ * <p>
34
+ * As this command returns both the numerical ID and the name of a permission,
35
+ * it is also useful for looking up a permission's ID based on its name
36
+ * and vice versa.
37
+ * </p>
38
+ */
31
39
public class CPermGet extends Command {
32
40
41
+ /**
42
+ * Looks up a permission value based on the permission's name.
43
+ *
44
+ * @param permName
45
+ * the name of the permission
46
+ */
33
47
public CPermGet (String permName ) {
34
48
super ("permget" );
35
49
add (new KeyValueParam ("permsid" , permName ));
36
50
}
37
51
52
+ /**
53
+ * Looks up a permission value based on the permission's numerical ID.
54
+ *
55
+ * @param permId
56
+ * the ID of the permission
57
+ */
58
+ public CPermGet (int permId ) {
59
+ super ("permget" );
60
+ add (new KeyValueParam ("permid" , permId ));
61
+ }
38
62
}
Original file line number Diff line number Diff line change 26
26
* #L%
27
27
*/
28
28
29
+ import com .github .theholywaffle .teamspeak3 .commands .parameter .ArrayParameter ;
29
30
import com .github .theholywaffle .teamspeak3 .commands .parameter .KeyValueParam ;
30
31
31
32
public class CPermIdGetByName extends Command {
@@ -35,4 +36,13 @@ public CPermIdGetByName(String permName) {
35
36
add (new KeyValueParam ("permsid" , permName ));
36
37
}
37
38
39
+ public CPermIdGetByName (String [] permNames ) {
40
+ super ("permidgetbyname" );
41
+ final ArrayParameter permissions = new ArrayParameter ();
42
+ for (String p : permNames ) {
43
+ permissions .add (new KeyValueParam ("permsid" , p ));
44
+ }
45
+ add (permissions );
46
+ }
47
+
38
48
}
You can’t perform that action at this time.
0 commit comments