Changeset 382 for binary-improvements2/MapRendering/Web/API
- Timestamp:
- Aug 1, 2022, 12:54:31 PM (2 years ago)
- Location:
- binary-improvements2/MapRendering/Web/API
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/API/ExecuteConsoleCommand.cs
r360 r382 1 1 using System; 2 2 using System.Net; 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 4 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 3 5 4 6 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetAllowedCommands.cs
r360 r382 1 1 using System.Net; 2 2 using AllocsFixes.JSON; 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 4 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 3 5 4 6 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetAnimalsLocation.cs
r351 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.LiveData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetHostileLocation.cs
r351 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.LiveData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetLandClaims.cs
r369 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.PersistentData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetLog.cs
r350 r382 2 2 using System.Net; 3 3 using AllocsFixes.JSON; 4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 4 6 5 7 namespace AllocsFixes.NetConnections.Servers.Web.API { … … 9 11 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user, 10 12 int _permissionLevel) { 11 int count, firstLine, lastLine; 12 13 if (_req.QueryString ["count"] == null || !int.TryParse (_req.QueryString ["count"], out count)) { 13 if (_req.QueryString ["count"] == null || !int.TryParse (_req.QueryString ["count"], out int count)) { 14 14 count = 50; 15 15 } … … 27 27 } 28 28 29 if (_req.QueryString ["firstLine"] == null || !int.TryParse (_req.QueryString ["firstLine"], out firstLine)) { 30 if (count > 0) { 31 firstLine = LogBuffer.Instance.OldestLine; 32 } else { 33 firstLine = LogBuffer.Instance.LatestLine; 34 } 29 if (_req.QueryString ["firstLine"] == null || !int.TryParse (_req.QueryString ["firstLine"], out int firstLine)) { 30 firstLine = count > 0 ? LogBuffer.Instance.OldestLine : LogBuffer.Instance.LatestLine; 35 31 } 36 32 37 33 JSONObject result = new JSONObject (); 38 34 39 List<LogBuffer.LogEntry> logEntries = LogBuffer.Instance.GetRange (ref firstLine, count, out lastLine);35 List<LogBuffer.LogEntry> logEntries = LogBuffer.Instance.GetRange (ref firstLine, count, out int lastLine); 40 36 41 37 JSONArray entries = new JSONArray (); … … 44 40 entry.Add ("date", new JSONString (logEntry.date)); 45 41 entry.Add ("time", new JSONString (logEntry.time)); 46 entry.Add ("uptime", new JSONString (logEntry.uptime)); 42 entry.Add ("isotime", new JSONString (logEntry.isoTime)); 43 entry.Add ("uptime", new JSONString (logEntry.uptime.ToString ())); 47 44 entry.Add ("msg", new JSONString (logEntry.message)); 48 45 entry.Add ("trace", new JSONString (logEntry.trace)); -
binary-improvements2/MapRendering/Web/API/GetPlayerInventories.cs
r369 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.PersistentData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetPlayerInventory.cs
r369 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.PersistentData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { 7 9 public class GetPlayerInventory : WebAPI { 8 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,9 int _permissionLevel) {10 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, 11 WebConnection _user, int _permissionLevel) { 10 12 if (_req.QueryString ["userid"] == null) { 11 13 _resp.StatusCode = (int) HttpStatusCode.BadRequest; -
binary-improvements2/MapRendering/Web/API/GetPlayerList.cs
r369 r382 6 6 using AllocsFixes.JSON; 7 7 using AllocsFixes.PersistentData; 8 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 9 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 8 10 9 11 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetPlayersLocation.cs
r369 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.PersistentData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetPlayersOnline.cs
r371 r382 3 3 using AllocsFixes.JSON; 4 4 using AllocsFixes.PersistentData; 5 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 6 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 5 7 6 8 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetServerInfo.cs
r360 r382 2 2 using System.Net; 3 3 using AllocsFixes.JSON; 4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 4 6 5 7 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetStats.cs
r351 r382 2 2 using AllocsFixes.JSON; 3 3 using AllocsFixes.LiveData; 4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 4 6 5 7 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/GetWebUIUpdates.cs
r351 r382 2 2 using AllocsFixes.JSON; 3 3 using AllocsFixes.LiveData; 4 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 5 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 4 6 5 7 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/Null.cs
r367 r382 1 1 using System.Net; 2 2 using System.Text; 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 4 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 3 5 4 6 namespace AllocsFixes.NetConnections.Servers.Web.API { -
binary-improvements2/MapRendering/Web/API/WebAPI.cs
r367 r382 1 using System.Net;2 1 using System.Text; 3 2 using AllocsFixes.JSON; 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 4 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 4 5 5 6 namespace AllocsFixes.NetConnections.Servers.Web.API { … … 44 45 } 45 46 46 public abstract void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,47 int _permissionLevel);47 public abstract void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, 48 WebConnection _user, int _permissionLevel); 48 49 49 50 public virtual int DefaultPermissionLevel () {
Note:
See TracChangeset
for help on using the changeset viewer.