- Timestamp:
- Aug 6, 2022, 11:32:32 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/API/GetAllowedCommands.cs
r383 r387 1 1 using AllocsFixes.JSON; 2 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;3 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;4 2 5 3 namespace AllocsFixes.NetConnections.Servers.Web.API { 6 public class GetAllowedCommands : WebAPI { 7 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user, 8 int _permissionLevel) { 4 public class GetAllowedCommands : AbsWebAPI { 5 public override void HandleRequest (RequestContext _context) { 9 6 JSONObject result = new JSONObject (); 10 7 JSONArray entries = new JSONArray (); 11 8 foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) { 12 9 int commandPermissionLevel = GameManager.Instance.adminTools.GetCommandPermissionLevel (cc.GetCommands ()); 13 if (_ permissionLevel <= commandPermissionLevel) {10 if (_context.PermissionLevel <= commandPermissionLevel) { 14 11 string cmd = string.Empty; 15 12 foreach (string s in cc.GetCommands ()) { … … 29 26 result.Add ("commands", entries); 30 27 31 W riteJSON (_resp, result);28 WebUtils.WriteJson (_context.Response, result); 32 29 } 33 30
Note:
See TracChangeset
for help on using the changeset viewer.