- Timestamp:
- Aug 6, 2022, 11:32:32 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/API/GetPlayersLocation.cs
r383 r387 2 2 using AllocsFixes.JSON; 3 3 using AllocsFixes.PersistentData; 4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;6 4 7 5 namespace AllocsFixes.NetConnections.Servers.Web.API { 8 public class GetPlayersLocation : WebAPI { 9 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user, 10 int _permissionLevel) { 6 public class GetPlayersLocation : AbsWebAPI { 7 public override void HandleRequest (RequestContext _context) { 11 8 AdminTools admTools = GameManager.Instance.adminTools; 12 PlatformUserIdentifierAbs userId = _ user?.UserId;9 PlatformUserIdentifierAbs userId = _context.Connection?.UserId; 13 10 14 11 bool listOffline = false; 15 if (_ req.QueryString ["offline"] != null) {16 bool.TryParse (_ req.QueryString ["offline"], out listOffline);12 if (_context.Request.QueryString ["offline"] != null) { 13 bool.TryParse (_context.Request.QueryString ["offline"], out listOffline); 17 14 } 18 15 19 bool bViewAll = WebConnection.CanViewAllPlayers (_ permissionLevel);16 bool bViewAll = WebConnection.CanViewAllPlayers (_context.PermissionLevel); 20 17 21 18 JSONArray playersJsResult = new JSONArray (); … … 57 54 } 58 55 59 W riteJSON (_resp, playersJsResult);56 WebUtils.WriteJson (_context.Response, playersJsResult); 60 57 } 61 58 }
Note:
See TracChangeset
for help on using the changeset viewer.