Changeset 408
- Timestamp:
- Feb 22, 2023, 5:51:32 PM (22 months ago)
- Location:
- binary-improvements2/WebServer/src/WebAPI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/WebAPI/APIs/Animal.cs
r402 r408 35 35 36 36 writer.WriteRaw (jsonKeyPosition); 37 JsonCommons.WritePositionObject ( writer, position);37 JsonCommons.WritePositionObject (ref writer, position); 38 38 39 39 writer.WriteEndObject (); -
binary-improvements2/WebServer/src/WebAPI/APIs/Command.cs
r404 r408 56 56 string cmd = string.Empty; 57 57 58 bool firstOverload = true; 59 foreach (string s in _command.GetCommands ()) { 60 if (!firstOverload) { 58 string[] ses = _command.GetCommands (); 59 for (int i = 0; i < ses.Length; i++) { 60 string s = ses [i]; 61 62 if (i > 0) { 61 63 _writer.WriteValueSeparator (); 62 64 } 63 firstOverload = false; 64 65 65 66 _writer.WriteString (s); 66 67 67 68 if (s.Length > cmd.Length) { 68 69 cmd = s; 69 70 } 70 71 } 71 72 72 73 _writer.WriteEndArray (); 73 74 … … 129 130 } 130 131 131 public override int DefaultPermissionLevel () { 132 return 2000; 133 } 132 public override int DefaultPermissionLevel () => 2000; 134 133 } 135 134 } -
binary-improvements2/WebServer/src/WebAPI/APIs/Hostile.cs
r402 r408 35 35 36 36 writer.WriteRaw (jsonKeyPosition); 37 JsonCommons.WritePositionObject ( writer, position);37 JsonCommons.WritePositionObject (ref writer, position); 38 38 39 39 writer.WriteEndObject (); -
binary-improvements2/WebServer/src/WebAPI/APIs/Log.cs
r402 r408 47 47 writer.WriteBeginArray (); 48 48 49 bool first = true; 50 foreach (LogBuffer.LogEntry logEntry in logEntries) { 51 if (!first) { 49 for (int i = 0; i < logEntries.Count; i++) { 50 LogBuffer.LogEntry logEntry = logEntries [i]; 51 52 if (i > 0) { 52 53 writer.WriteValueSeparator (); 53 54 } 54 55 55 first = false;56 57 56 writer.WriteRaw (jsonMsgKey); 58 57 writer.WriteString (logEntry.message); 59 58 60 59 writer.WriteRaw (jsonTypeKey); 61 60 writer.WriteString (logEntry.type.ToStringCached ()); 62 61 63 62 writer.WriteRaw (jsonTraceKey); 64 63 writer.WriteString (logEntry.trace); 65 64 66 65 writer.WriteRaw (jsonIsotimeKey); 67 66 writer.WriteString (logEntry.isoTime); 68 67 69 68 writer.WriteRaw (jsonUptimeKey); 70 69 writer.WriteString (logEntry.uptime.ToString ()); 71 70 72 71 writer.WriteEndObject (); 73 72 } 73 74 74 writer.WriteEndArray (); 75 75 -
binary-improvements2/WebServer/src/WebAPI/APIs/ServerStats.cs
r402 r408 47 47 } 48 48 49 public override int DefaultPermissionLevel () { 50 return 2000; 51 } 49 public override int DefaultPermissionLevel () => 2000; 52 50 } 53 51 } -
binary-improvements2/WebServer/src/WebAPI/APIs/WebMods.cs
r402 r408 11 11 writer.WriteBeginArray (); 12 12 13 bool first = true; 14 foreach (WebMod webMod in _parent.webMods) { 15 if (!first) { 13 for (int i = 0; i < _parent.webMods.Count; i++) { 14 WebMod webMod = _parent.webMods [i]; 15 16 if (i > 0) { 16 17 writer.WriteValueSeparator (); 17 18 } 18 first = false; 19 19 20 20 writer.WriteBeginObject (); 21 21 22 22 writer.WriteString ("name"); 23 23 writer.WriteNameSeparator (); … … 31 31 writer.WriteString (webModReactBundle); 32 32 } 33 33 34 34 string webModCssFile = webMod.CssPath; 35 35 if (webModCssFile != null) { … … 39 39 writer.WriteString (webModCssFile); 40 40 } 41 41 42 42 writer.WriteEndObject (); 43 43 } 44 44 45 45 writer.WriteEndArray (); 46 46 … … 54 54 } 55 55 56 public override int DefaultPermissionLevel () { 57 return 2000; 58 } 56 public override int DefaultPermissionLevel () => 2000; 59 57 } 60 58 } -
binary-improvements2/WebServer/src/WebAPI/APIs/WebUiUpdates.cs
r402 r408 57 57 } 58 58 59 public override int DefaultPermissionLevel () { 60 return 2000; 61 } 59 public override int DefaultPermissionLevel () => 2000; 62 60 } 63 61 } -
binary-improvements2/WebServer/src/WebAPI/JsonCommons.cs
r402 r408 7 7 private static readonly byte[] jsonKeyPositionZ = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("z"); 8 8 9 public static void WritePositionObject ( JsonWriter _writer, Vector3i _position) {9 public static void WritePositionObject (ref JsonWriter _writer, Vector3i _position) { 10 10 _writer.WriteRaw (jsonKeyPositionX); 11 11 _writer.WriteInt32 (_position.x);
Note:
See TracChangeset
for help on using the changeset viewer.