Changeset 425 for binary-improvements2/WebServer
- Timestamp:
- Apr 10, 2023, 8:23:15 PM (19 months ago)
- Location:
- binary-improvements2/WebServer
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/ModInfo.xml
r423 r425 5 5 <Description value="Integrated Webserver for the Web Dashboard and server APIs" /> 6 6 <Author value="The Fun Pimps LLC" /> 7 <Version value="21.0.25 0.0" />7 <Version value="21.0.258.0" /> 8 8 <Website value="" /> 9 9 </xml> -
binary-improvements2/WebServer/WebServer.csproj
r422 r425 112 112 <Compile Include="src\Permissions\AdminApiTokens.cs" /> 113 113 <Compile Include="src\Permissions\AdminWebUsers.cs" /> 114 <Compile Include="src\Permissions\PermissionUtils.cs" /> 114 115 <Compile Include="src\Permissions\RegisterModules.cs" /> 115 116 <Compile Include="src\UserRegistrationTokens.cs" /> … … 128 129 <Compile Include="src\WebAPI\APIs\Hostile.cs" /> 129 130 <Compile Include="src\WebAPI\APIs\Log.cs" /> 131 <Compile Include="src\WebAPI\APIs\Player.cs" /> 130 132 <Compile Include="src\WebAPI\APIs\RegisterUser.cs" /> 131 133 <Compile Include="src\WebAPI\APIs\ServerInfo.cs" /> -
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.