- Timestamp:
- Jul 28, 2023, 8:42:10 PM (16 months ago)
- Location:
- binary-improvements/MapRendering/API
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/API/GetAllowedCommands.cs
r453 r454 1 using System.Net;2 1 using AllocsFixes.JSON; 2 using Webserver; 3 using Webserver.WebAPI; 3 4 4 namespace AllocsFixes.NetConnections.Servers.Web.API { 5 public class GetAllowedCommands : WebAPI { 6 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user, 7 int _permissionLevel) { 5 namespace AllocsFixes.WebAPIs { 6 public class GetAllowedCommands : AbsWebAPI { 7 public override void HandleRequest (RequestContext _context) { 8 8 JSONObject result = new JSONObject (); 9 9 JSONArray entries = new JSONArray (); 10 10 foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) { 11 11 int commandPermissionLevel = GameManager.Instance.adminTools.Commands.GetCommandPermissionLevel (cc.GetCommands ()); 12 if (_ permissionLevel <= commandPermissionLevel) {12 if (_context.PermissionLevel <= commandPermissionLevel) { 13 13 string cmd = string.Empty; 14 14 foreach (string s in cc.GetCommands ()) { … … 28 28 result.Add ("commands", entries); 29 29 30 WriteJSON (_resp, result);30 LegacyApiHelper.WriteJSON (_context.Response, result); 31 31 } 32 32
Note:
See TracChangeset
for help on using the changeset viewer.