Phase 0: fix runtime script compilation

ScriptCompiler.Compile() runs `dotnet build Scripts/Scripts.csproj -c Release`
with no Platform, so MSBuild defaults to AnyCPU. Scripts.csproj gated both
OutputPath and DefineConstants on Configuration|Platform == Release|x64, so
under the server's own build the DLL landed in Scripts/bin/Release/ (while the
core loads Scripts.dll from the base directory) and TRACE;NEWTIMERS;ServUO went
undefined (XmlSpawner compiled its non-ServUO branches).

Compile() also never checks the build's exit code before Assembly.LoadFrom, so
the failure was silent and the stale DLL reloaded. Runtime script compilation
had had no effect since 2026-05-30.

Condition both property groups on Configuration alone. Server.csproj is left
alone: nothing under Server/ uses those symbols, and giving it OutputPath=..\
would make the boot-time build try to overwrite the running ServUO.exe.

Verified end-to-end: a plain boot now logs "Core: Compiling scripts... / Build
succeeded." and loads 206208 items, 42771 mobiles.

Also adds the implementation plan, the measured performance budget, the test
scaffolding used to produce it (seeder + probe, both default-off), and the
record of shard repairs that had to precede any of this.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 04:34:18 -05:00
commit 710dd17745
11 changed files with 2036 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<AssemblyName>Scripts</AssemblyName>
<RootNamespace>Server</RootNamespace>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseVSHostingProcess>False</UseVSHostingProcess>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<UseWindowsForms>false</UseWindowsForms>
<Platforms>x64</Platforms>
</PropertyGroup>
<!--
Conditioned on Configuration alone, not Configuration|Platform. ScriptCompiler.Compile
runs `dotnet build Scripts/Scripts.csproj -c Release` with no Platform, so Platform
defaults to AnyCPU. Under the old Platform-qualified conditions that meant OutputPath
was unset (the DLL landed in Scripts/bin/Release/ while the core loads Scripts.dll from
the base directory) and DefineConstants were empty (XmlSpawner compiled its non-ServUO
branches). The net effect was that runtime script compilation silently had no effect.
-->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Server\Server.csproj" />
<ProjectReference Include="..\Ultima\Ultima.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
</Project>