source: binary-improvements/7dtd-server-fixes/src/AdminToolsStuff.cs@ 85

Last change on this file since 85 was 84, checked in by alloc, 10 years ago

fixes

File size: 757 bytes
Line 
1using System;
2using System.Collections.Generic;
3
4public 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.