- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetAllowedCommands.cs
r279 r325 1 using System.Net; 1 2 using AllocsFixes.JSON; 2 using AllocsFixes.PersistentData;3 using System;4 using System.Collections.Generic;5 using System.Net;6 3 7 namespace AllocsFixes.NetConnections.Servers.Web.API 8 { 4 namespace AllocsFixes.NetConnections.Servers.Web.API { 9 5 public class GetAllowedCommands : WebAPI { 10 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) { 6 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, 7 int permissionLevel) { 11 8 JSONObject result = new JSONObject (); 12 9 JSONArray entries = new JSONArray (); 13 10 foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) { 14 AdminToolsCommandPermissions atcp = GameManager.Instance.adminTools.GetAdminToolsCommandPermission (cc.GetCommands ()); 11 AdminToolsCommandPermissions atcp = 12 GameManager.Instance.adminTools.GetAdminToolsCommandPermission (cc.GetCommands ()); 15 13 if (permissionLevel <= atcp.PermissionLevel) { 16 14 string cmd = string.Empty; … … 20 18 } 21 19 } 20 22 21 JSONObject cmdObj = new JSONObject (); 23 22 cmdObj.Add ("command", new JSONString (cmd)); … … 38 37 } 39 38 } 40
Note:
See TracChangeset
for help on using the changeset viewer.