From da768fff9ee5994140d23bf627eee21dfbae2e3b Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 25 Jun 2026 23:20:48 -0700 Subject: [PATCH] Cleanup --- .../Engines/Spawners/Commands/ExportSpawnersCommand.cs | 1 - .../Engines/Spawners/SpawnerJsonSerializer.cs | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Projects/UOContent/Engines/Spawners/Commands/ExportSpawnersCommand.cs b/Projects/UOContent/Engines/Spawners/Commands/ExportSpawnersCommand.cs index 04a00b603..abaa3f9dc 100644 --- a/Projects/UOContent/Engines/Spawners/Commands/ExportSpawnersCommand.cs +++ b/Projects/UOContent/Engines/Spawners/Commands/ExportSpawnersCommand.cs @@ -17,7 +17,6 @@ using System; using System.Collections.Generic; using System.IO; using Server.Commands.Generic; -using Server.Json; using Server.Network; namespace Server.Engines.Spawners; diff --git a/Projects/UOContent/Engines/Spawners/SpawnerJsonSerializer.cs b/Projects/UOContent/Engines/Spawners/SpawnerJsonSerializer.cs index 1c5eb7a6a..61213b05a 100644 --- a/Projects/UOContent/Engines/Spawners/SpawnerJsonSerializer.cs +++ b/Projects/UOContent/Engines/Spawners/SpawnerJsonSerializer.cs @@ -30,7 +30,7 @@ public static class SpawnerJsonSerializer { private static readonly ILogger logger = LogFactory.GetLogger(typeof(SpawnerJsonSerializer)); - private static JsonDerivedType[] _derivedTypes = Array.Empty(); + private static JsonDerivedType[] _derivedTypes; private static JsonSerializerOptions _options; /// @@ -92,6 +92,7 @@ public static class SpawnerJsonSerializer var attr = (JsonDiscoverableTypeAttribute)Attribute.GetCustomAttribute( type, typeof(JsonDiscoverableTypeAttribute), false); + var discriminator = attr?.Discriminator ?? type.Name; if (byDiscriminator.TryGetValue(discriminator, out var existing)) { @@ -169,8 +170,7 @@ public static class SpawnerJsonSerializer } // --- Compact writer (matches the on-disk spawn-file layout used by [ExportSpawners) --- - - private const int CompactPrintWidth = 100; + private const int CompactPrintWidth = 125; private static readonly JsonSerializerOptions _scalarOptions = new() { @@ -179,8 +179,8 @@ public static class SpawnerJsonSerializer /// /// Serializes to the compact spawn-file layout: a container is inline only when all its values - /// are scalars and the line fits within 100 columns; otherwise it expands (2-space indent). - /// UTF-8, LF, no BOM. Admin/cold path. + /// are scalars and the line fits within 125 characters; otherwise it expands (2-space indent). + /// UTF-8, LF. Admin/cold path. /// public static string SerializeCompact(T value) {