Changeset 425 for binary-improvements2/WebServer/src
- Timestamp:
- Apr 10, 2023, 8:23:15 PM (19 months ago)
- Location:
- binary-improvements2/WebServer/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/SSE/EventLog.cs
r402 r425 4 4 using Utf8Json; 5 5 using Webserver.UrlHandlers; 6 using Webserver.WebAPI; 6 7 7 8 namespace Webserver.SSE { … … 19 20 20 21 private void LogCallback (string _formattedMsg, string _plainMsg, string _trace, LogType _type, DateTime _timestamp, long _uptime) { 21 string isotime = _timestamp.ToString ("o");22 22 string uptime = _uptime.ToString (); 23 23 … … 34 34 35 35 writer.WriteRaw (jsonIsotimeKey); 36 writer.WriteString (isotime);36 JsonCommons.WriteDateTime (ref writer, _timestamp); 37 37 38 38 writer.WriteRaw (jsonUptimeKey); -
binary-improvements2/WebServer/src/WebAPI/JsonCommons.cs
r408 r425 1 using System; 2 using UnityEngine; 1 3 using Utf8Json; 2 4 … … 19 21 _writer.WriteEndObject (); 20 22 } 21 23 24 public static void WritePositionObject (ref JsonWriter _writer, Vector3 _position) { 25 _writer.WriteRaw (jsonKeyPositionX); 26 _writer.WriteSingle (_position.x); 27 28 _writer.WriteRaw (jsonKeyPositionY); 29 _writer.WriteSingle (_position.y); 30 31 _writer.WriteRaw (jsonKeyPositionZ); 32 _writer.WriteSingle (_position.z); 33 34 _writer.WriteEndObject (); 35 } 36 37 private static readonly byte[] jsonKeyCombinedString = JsonWriter.GetEncodedPropertyNameWithBeginObject ("combinedString"); 38 private static readonly byte[] jsonKeyPlatformId = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("platformId"); 39 private static readonly byte[] jsonKeyUserId = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("userId"); 40 41 public static void WritePlatformUserIdentifier (ref JsonWriter _writer, PlatformUserIdentifierAbs _userIdentifier) { 42 if (_userIdentifier == null) { 43 _writer.WriteNull (); 44 return; 45 } 46 47 _writer.WriteRaw (jsonKeyCombinedString); 48 _writer.WriteString (_userIdentifier.CombinedString); 49 50 _writer.WriteRaw (jsonKeyPlatformId); 51 _writer.WriteString (_userIdentifier.PlatformIdentifierString); 52 53 _writer.WriteRaw (jsonKeyUserId); 54 _writer.WriteString (_userIdentifier.ReadablePlatformUserIdentifier); 55 56 _writer.WriteEndObject (); 57 } 58 59 public static void WriteDateTime (ref JsonWriter _writer, DateTime _dateTime) { 60 _writer.WriteString (_dateTime.ToString ("o")); 61 } 22 62 } 23 63 } -
binary-improvements2/WebServer/src/WebConnection.cs
r404 r425 33 33 } 34 34 35 public static bool CanViewAllPlayers (int _permissionLevel) {36 return AdminWebModules.Instance.ModuleAllowedWithLevel ("webapi.viewallplayers", _permissionLevel);37 }38 39 public static bool CanViewAllClaims (int _permissionLevel) {40 return AdminWebModules.Instance.ModuleAllowedWithLevel ("webapi.viewallclaims", _permissionLevel);41 }42 43 35 public void UpdateUsage () { 44 36 lastAction = DateTime.Now; -
binary-improvements2/WebServer/src/WebUtils.cs
r422 r425 5 5 using System.Text; 6 6 using Utf8Json; 7 using Webserver.WebAPI; 7 8 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 8 9 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; … … 80 81 81 82 _writer.WriteRaw (jsonRawMetaServertimeKey); 82 _writer.WriteString (DateTime.Now.ToString ("o"));83 JsonCommons.WriteDateTime (ref _writer, DateTime.Now); 83 84 84 85 if (!string.IsNullOrEmpty (_errorCode)) {
Note:
See TracChangeset
for help on using the changeset viewer.