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/GetPlayersLocation.cs

    r453 r454  
    11using System.Collections.Generic;
    2 using System.Net;
    32using AllocsFixes.JSON;
    43using AllocsFixes.PersistentData;
     4using Webserver;
     5using Webserver.Permissions;
     6using Webserver.WebAPI;
    57
    6 namespace AllocsFixes.NetConnections.Servers.Web.API {
    7         public class GetPlayersLocation : WebAPI {
    8                 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
    9                         int _permissionLevel) {
     8namespace AllocsFixes.WebAPIs {
     9        public class GetPlayersLocation : AbsWebAPI {
     10                public override void HandleRequest (RequestContext _context) {
    1011                        AdminTools admTools = GameManager.Instance.adminTools;
    11                         PlatformUserIdentifierAbs userId = _user?.UserId;
     12                        PlatformUserIdentifierAbs userId = _context.Connection?.UserId;
    1213
    1314                        bool listOffline = false;
    14                         if (_req.QueryString ["offline"] != null) {
    15                                 bool.TryParse (_req.QueryString ["offline"], out listOffline);
     15                        if (_context.Request.QueryString ["offline"] != null) {
     16                                bool.TryParse (_context.Request.QueryString ["offline"], out listOffline);
    1617                        }
    1718
    18                         bool bViewAll = WebConnection.CanViewAllPlayers (_permissionLevel);
     19                        bool bViewAll = PermissionUtils.CanViewAllPlayers (_context.PermissionLevel);
    1920
    2021                        JSONArray playersJsResult = new JSONArray ();
     
    5758                        }
    5859
    59                         WriteJSON (_resp, playersJsResult);
     60                        LegacyApiHelper.WriteJSON (_context.Response, playersJsResult);
    6061                }
    6162        }
Note: See TracChangeset for help on using the changeset viewer.