Rev | Line | |
---|
[84] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 |
|
---|
| 4 | public class AdminToolsStuff
|
---|
| 5 | {
|
---|
| 6 | public static string[] GetAllowedCommandsList (AdminTools admTools, string _steamID)
|
---|
| 7 | {
|
---|
| 8 | AdminToolsClientInfo tmpInfo = admTools.GetClientCommandInfo (_steamID);
|
---|
| 9 |
|
---|
| 10 | List<AdminToolsCommandPermissions> perms = admTools.commandPermissions;
|
---|
| 11 | List<string> allowed = new List<string> ();
|
---|
| 12 |
|
---|
| 13 | foreach (AdminToolsCommandPermissions atcp in perms) {
|
---|
| 14 | if (tmpInfo.SteamID != null && tmpInfo.SteamID.Length > 0) {
|
---|
| 15 | if ((atcp.PermissionLevel >= tmpInfo.PermissionLevel) || (atcp.PermissionLevel >= 1000)) {
|
---|
| 16 | allowed.Add (atcp.Command);
|
---|
| 17 | }
|
---|
| 18 | } else {
|
---|
| 19 | if (atcp.PermissionLevel >= 1000) {
|
---|
| 20 | allowed.Add (atcp.Command);
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | return allowed.ToArray ();
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
| 28 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.