Changeset 459 for TFP-WebServer/WebServer/src
- Timestamp:
- Aug 9, 2023, 9:41:32 PM (15 months ago)
- Location:
- TFP-WebServer/WebServer/src
- Files:
-
- 6 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/UrlHandlers/ApiHandler.cs
r453 r459 48 48 private void addApi (AbsWebAPI _api) { 49 49 apis.Add (_api.Name, _api); 50 parent.OpenApiHelpers.LoadOpenApiSpec (_api); 50 51 } 51 52 -
TFP-WebServer/WebServer/src/Web.cs
r453 r459 8 8 using Webserver.Permissions; 9 9 using Webserver.UrlHandlers; 10 using Webserver.WebAPI; 10 11 using Cookie = System.Net.Cookie; 11 12 using HttpStatusCode = System.Net.HttpStatusCode; … … 21 22 public readonly List<WebMod> WebMods = new List<WebMod> (); 22 23 public readonly ConnectionHandler ConnectionHandler; 24 public readonly OpenApiHelpers OpenApiHelpers; 23 25 24 26 private readonly HttpListener listener = new HttpListener (); … … 51 53 52 54 ConnectionHandler = new ConnectionHandler (); 55 OpenApiHelpers = new OpenApiHelpers (); 53 56 54 57 RegisterDefaultHandlers (_modInstancePath); -
TFP-WebServer/WebServer/src/WebAPI/APIs/LogApi.cs
r458 r459 5 5 namespace Webserver.WebAPI.APIs { 6 6 [UsedImplicitly] 7 public class Log : AbsRestApi {7 public class LogApi : AbsRestApi { 8 8 private const int maxCount = 1000; 9 9 … … 17 17 private static readonly byte[] jsonIsotimeKey = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("isotime"); 18 18 private static readonly byte[] jsonUptimeKey = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("uptime"); 19 19 20 public LogApi () : base ("Log") { 21 } 22 20 23 protected override void HandleRestGet (RequestContext _context) { 21 24 if (_context.Request.QueryString ["count"] == null || !int.TryParse (_context.Request.QueryString ["count"], out int count)) { -
TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/RegisterUser.cs
r453 r459 95 95 // Log info 96 96 string crossplatformidString = regData.CrossPlatformUserId == null ? "" : $", crossplatform ID {regData.CrossPlatformUserId.CombinedString}"; 97 global::Log.Out ($"[Web] User registered: Username '{username}' for platform ID {regData.PlatformUserId.CombinedString}{crossplatformidString}");97 Log.Out ($"[Web] User registered: Username '{username}' for platform ID {regData.PlatformUserId.CombinedString}{crossplatformidString}"); 98 98 99 99 if (AdminWebUsers.Instance.HasUser (regData.PlatformUserId, regData.CrossPlatformUserId, out AdminWebUsers.WebUser existingUser)) { 100 100 // Remove existing username of player, only allowing one user per player 101 101 102 global::Log.Out ($"[Web] Re-registration, replacing existing username '{existingUser.Name}'");102 Log.Out ($"[Web] Re-registration, replacing existing username '{existingUser.Name}'"); 103 103 AdminWebUsers.Instance.RemoveUser (existingUser.Name); 104 104 } -
TFP-WebServer/WebServer/src/WebAPI/APIs/WorldState/Player.cs
r444 r459 93 93 ClientInfo ci = ConnectionManager.Instance.Clients.ForUserId (_nativeUserId); 94 94 if (ci == null) { 95 global::Log.Warning ($"[Web] Player.GET: ClientInfo null");95 Log.Warning ($"[Web] Player.GET: ClientInfo null"); 96 96 return; 97 97 } … … 101 101 102 102 if (entity == null) { 103 global::Log.Warning ($"[Web] Player.GET: EntityPlayer null");103 Log.Warning ($"[Web] Player.GET: EntityPlayer null"); 104 104 return; 105 105 }
Note:
See TracChangeset
for help on using the changeset viewer.