Ignore:
Timestamp:
Jul 28, 2023, 8:42:10 PM (16 months ago)
Author:
alloc
Message:

24_29_43
Switched over to vanilla Web infrastructure

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;
    21using AllocsFixes.JSON;
     2using Webserver;
     3using Webserver.WebAPI;
    34
    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) {
     5namespace AllocsFixes.WebAPIs {
     6        public class GetAllowedCommands : AbsWebAPI {
     7                public override void HandleRequest (RequestContext _context) {
    88                        JSONObject result = new JSONObject ();
    99                        JSONArray entries = new JSONArray ();
    1010                        foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) {
    1111                                int commandPermissionLevel = GameManager.Instance.adminTools.Commands.GetCommandPermissionLevel (cc.GetCommands ());
    12                                 if (_permissionLevel <= commandPermissionLevel) {
     12                                if (_context.PermissionLevel <= commandPermissionLevel) {
    1313                                        string cmd = string.Empty;
    1414                                        foreach (string s in cc.GetCommands ()) {
     
    2828                        result.Add ("commands", entries);
    2929
    30                         WriteJSON (_resp, result);
     30                        LegacyApiHelper.WriteJSON (_context.Response, result);
    3131                }
    3232
Note: See TracChangeset for help on using the changeset viewer.