Ignore:
Timestamp:
Aug 6, 2022, 11:32:32 PM (2 years ago)
Author:
alloc
Message:

Big refactoring in Web to pass around a Context instead of a bunch of individual arguments all the time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/MapRendering/Web/API/GetHostileLocation.cs

    r383 r387  
    22using AllocsFixes.JSON;
    33using AllocsFixes.LiveData;
    4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;
    5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
    64
    75namespace AllocsFixes.NetConnections.Servers.Web.API {
    8         internal class GetHostileLocation : WebAPI {
     6        internal class GetHostileLocation : AbsWebAPI {
    97                private readonly List<EntityEnemy> enemies = new List<EntityEnemy> ();
    108
    11                 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
    12                         int _permissionLevel) {
     9                public override void HandleRequest (RequestContext _context) {
    1310                        JSONArray hostilesJsResult = new JSONArray ();
    1411
     
    3734                        }
    3835
    39                         WriteJSON (_resp, hostilesJsResult);
     36                        WebUtils.WriteJson (_context.Response, hostilesJsResult);
    4037                }
    4138        }
Note: See TracChangeset for help on using the changeset viewer.