RynthCore as of 2026-10-04 (internal 843c801): RynthNav auto-travel and the navigation map, plugin API v75 (server and titles), launcher with Available plugins, download progress and the update on the front page, opt-in usage statistics, NPC names, radar colours, title-bar text size, FPS limiter, client action unlocks, release 2026.10.4.6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b5e2765b7
commit
a24ed6df7c
322 changed files with 83009 additions and 7504 deletions
93
scripts/Build-Cimgui.ps1
Normal file
93
scripts/Build-Cimgui.ps1
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Builds the engine's 32-bit cimgui.dll from pinned upstream sources.
|
||||
|
||||
.DESCRIPTION
|
||||
Fetches cimgui at tag 1.91.6dock (and its Dear ImGui submodule) into
|
||||
native\cimgui\_src, verifies both commits, fetches ImGuiColorTextEdit
|
||||
(santaclose fork, the Meta/Lua source editor) into native\cimgui\_textedit
|
||||
at a pinned commit and applies native\cimgui\textedit-rynth.patch, builds
|
||||
with MSVC via CMake (Win32, Release, static CRT) using
|
||||
native\cimgui\CMakeLists.txt, and copies
|
||||
the result to src\RynthCore.Engine\Native\cimgui.dll.
|
||||
|
||||
Why a custom build: ImGui.NET 1.91.6.1 treats ImTextureID as a pointer,
|
||||
but Dear ImGui 1.91.6 defaults it to a 64-bit integer, so on x86 the stock
|
||||
NuGet cimgui.dll does not match the wrapper (see native\cimgui\rynth_imconfig.h).
|
||||
|
||||
Needs git and Visual Studio 2022 (Build Tools is enough) with the C++
|
||||
workload; CMake is taken from PATH or from the VS install.
|
||||
|
||||
.PARAMETER Clean
|
||||
Delete the CMake build directory first.
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[switch]$Clean
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$Tag = '1.91.6dock'
|
||||
$CimguiCommit = '970c614802935f51f451aa21ae06e838bdcf9349'
|
||||
$ImguiCommit = '947aa9c9722bd6ff740dd757da609ff41f4d3ba3'
|
||||
$TextEditCommit = '264bee49ddc3c789b05d928d09c628649458da47'
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$nativeDir = Join-Path $repoRoot 'native\cimgui'
|
||||
$srcDir = Join-Path $nativeDir '_src'
|
||||
$textEditDir = Join-Path $nativeDir '_textedit'
|
||||
$textEditPatch = Join-Path $nativeDir 'textedit-rynth.patch'
|
||||
$buildDir = Join-Path $nativeDir '_build'
|
||||
$outDll = Join-Path $repoRoot 'src\RynthCore.Engine\Native\cimgui.dll'
|
||||
|
||||
function Invoke-Checked([string]$What, [scriptblock]$Command) {
|
||||
& $Command
|
||||
if ($LASTEXITCODE -ne 0) { throw "$What failed (exit $LASTEXITCODE)" }
|
||||
}
|
||||
|
||||
# ---- Sources ----
|
||||
if (-not (Test-Path -LiteralPath $srcDir)) {
|
||||
Write-Host "Fetching cimgui $Tag ..."
|
||||
Invoke-Checked 'git clone' { git clone -q --depth 1 --branch $Tag --recurse-submodules --shallow-submodules https://github.com/cimgui/cimgui $srcDir }
|
||||
}
|
||||
$head = (git -C $srcDir rev-parse HEAD).Trim()
|
||||
$imguiHead = (git -C (Join-Path $srcDir 'imgui') rev-parse HEAD).Trim()
|
||||
if ($head -ne $CimguiCommit) { throw "native\cimgui\_src is at $head, expected $CimguiCommit ($Tag). Delete _src and rerun." }
|
||||
if ($imguiHead -ne $ImguiCommit) { throw "native\cimgui\_src\imgui is at $imguiHead, expected $ImguiCommit. Delete _src and rerun." }
|
||||
|
||||
# ImGuiColorTextEdit: no submodules (its Boost.Regex is replaced by
|
||||
# textedit_shim\boost\regex.hpp). LF checkout so the committed patch applies.
|
||||
if (-not (Test-Path -LiteralPath $textEditDir)) {
|
||||
Write-Host "Fetching ImGuiColorTextEdit $TextEditCommit ..."
|
||||
Invoke-Checked 'git clone (textedit)' { git -c core.autocrlf=false clone -q --no-checkout https://github.com/santaclose/ImGuiColorTextEdit $textEditDir }
|
||||
Invoke-Checked 'git checkout (textedit)' { git -C $textEditDir -c core.autocrlf=false checkout -q $TextEditCommit }
|
||||
}
|
||||
$teHead = (git -C $textEditDir rev-parse HEAD).Trim()
|
||||
if ($teHead -ne $TextEditCommit) { throw "native\cimgui\_textedit is at $teHead, expected $TextEditCommit. Delete _textedit and rerun." }
|
||||
git -C $textEditDir apply --reverse --check $textEditPatch 2>$null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Invoke-Checked 'git apply (textedit patch)' { git -C $textEditDir apply $textEditPatch }
|
||||
}
|
||||
|
||||
# ---- CMake ----
|
||||
$cmake = (Get-Command cmake -ErrorAction SilentlyContinue).Source
|
||||
if (-not $cmake) {
|
||||
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
|
||||
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if (-not $vs) { throw 'Visual Studio with the C++ x86/x64 tools was not found.' }
|
||||
$cmake = Join-Path $vs 'Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe'
|
||||
if (-not (Test-Path -LiteralPath $cmake)) { throw "CMake not found on PATH or at $cmake" }
|
||||
}
|
||||
|
||||
if ($Clean -and (Test-Path -LiteralPath $buildDir)) { Remove-Item -LiteralPath $buildDir -Recurse -Force }
|
||||
|
||||
Invoke-Checked 'cmake configure' { & $cmake -S $nativeDir -B $buildDir -G 'Visual Studio 17 2022' -A Win32 }
|
||||
Invoke-Checked 'cmake build' { & $cmake --build $buildDir --config Release }
|
||||
|
||||
$built = Join-Path $buildDir 'Release\cimgui.dll'
|
||||
if (-not (Test-Path -LiteralPath $built)) { throw "Build produced no $built" }
|
||||
|
||||
Copy-Item -LiteralPath $built -Destination $outDll -Force
|
||||
$size = (Get-Item -LiteralPath $outDll).Length
|
||||
Write-Host "cimgui.dll ($size bytes) -> $outDll"
|
||||
|
|
@ -15,7 +15,13 @@ param(
|
|||
# -AcClient overrides the binary it checks (default: auto-detect the private
|
||||
# copy under $Destination\AcClient, else C:\Turbine\Asheron's Call).
|
||||
[switch]$SkipPatternCheck,
|
||||
[string]$AcClient = ""
|
||||
[string]$AcClient = "",
|
||||
# The old deploy: NativeAOT loader, engine and plugins (a hot reload leaks every
|
||||
# generation). The default since 2026-09-29 is the unloadable engine
|
||||
# (docs/UNLOADABLE_ENGINE_PLAN.md): native loader + CoreCLR engine + app-local runtime
|
||||
# in Runtime\ (scripts\Publish-EngineCoreClr.ps1), and managed plugins, all of which
|
||||
# a hot reload frees. Releases (installer\) still ship NativeAOT: players run that engine.
|
||||
[switch]$NativeAot
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
|
@ -38,7 +44,6 @@ $loaderProject = Join-Path $repoRoot "src\RynthCore.Loader\RynthCore.Loader.cspr
|
|||
$rynthAiSourceRoot = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthAi"
|
||||
$rynthChatSourceRoot = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthChat"
|
||||
$rynthVisionSourceRoot = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthVision"
|
||||
$rynthJuiceSourceRoot = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthJuice"
|
||||
$pluginProjects = @(
|
||||
@{
|
||||
Project = Join-Path $rynthAiSourceRoot "RynthCore.Plugin.RynthAi.csproj"
|
||||
|
|
@ -67,15 +72,6 @@ $pluginProjects = @(
|
|||
DllName = "RynthCore.Plugin.RynthTracker.dll"
|
||||
DestSubdir = "RynthTracker"
|
||||
},
|
||||
# RynthJuice sets <PublishDir> to its deploy home (like RynthVision), so
|
||||
# publish lands directly in $PluginsDestination\RynthJuice and the copy step
|
||||
# below detects source == dest and skips the redundant self-copy.
|
||||
@{
|
||||
Project = Join-Path $rynthJuiceSourceRoot "RynthCore.Plugin.RynthJuice.csproj"
|
||||
Publish = Join-Path $PluginsDestination "RynthJuice"
|
||||
DllName = "RynthCore.Plugin.RynthJuice.dll"
|
||||
DestSubdir = "RynthJuice"
|
||||
},
|
||||
# RynthNav also publishes straight to its deploy home via <PublishDir>.
|
||||
# It was missing from this list entirely, so full deploys never refreshed it.
|
||||
@{
|
||||
|
|
@ -83,6 +79,13 @@ $pluginProjects = @(
|
|||
Publish = Join-Path $PluginsDestination "RynthNav"
|
||||
DllName = "RynthCore.Plugin.RynthNav.dll"
|
||||
DestSubdir = "RynthNav"
|
||||
},
|
||||
# RynthLua: Lua scripting, split out of RynthAi on 2026-09-29.
|
||||
@{
|
||||
Project = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthLua\RynthCore.Plugin.RynthLua.csproj"
|
||||
Publish = "C:\Projects\RynthSuite\Plugins\RynthCore.Plugin.RynthLua\bin\Release\net10.0-windows\win-x86\publish"
|
||||
DllName = "RynthCore.Plugin.RynthLua.dll"
|
||||
DestSubdir = "RynthLua"
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -158,6 +161,13 @@ function Invoke-Publish {
|
|||
}
|
||||
}
|
||||
|
||||
# Managed plugins publish to (and deploy from) out\plugins-clr\<name>, -SkipPublish too.
|
||||
if (-not $NativeAot) {
|
||||
foreach ($plugin in $pluginProjects) {
|
||||
$plugin.Publish = Join-Path $repoRoot ("out\plugins-clr\" + $plugin.DestSubdir)
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $SkipPublish) {
|
||||
$env:DOTNET_CLI_HOME = Join-Path $repoRoot ".dotnet-home-deploy-clean"
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "1"
|
||||
|
|
@ -166,10 +176,24 @@ if (-not $SkipPublish) {
|
|||
# --self-contained false is required: omitting it with the launcher's IncludeNativeLibrariesForSelfExtract=true produces a broken half-payload (apphost + coreclr.dll, no framework) that reports ".NET is not installed".
|
||||
Invoke-Publish -What "launcher" -Arguments @('publish', $launcherProject, '-c', 'Release', '-r', 'win-x86', '--self-contained', 'false')
|
||||
}
|
||||
Invoke-Publish -What "engine" -Arguments @('publish', $engineProject, '-c', 'Release')
|
||||
Invoke-Publish -What "loader" -Arguments @('publish', $loaderProject, '-c', 'Release')
|
||||
if ($NativeAot) {
|
||||
Invoke-Publish -What "engine" -Arguments @('publish', $engineProject, '-c', 'Release')
|
||||
Invoke-Publish -What "loader" -Arguments @('publish', $loaderProject, '-c', 'Release')
|
||||
}
|
||||
# (CoreCLR: the engine, loader and shim are built by Publish-EngineCoreClr.ps1 below,
|
||||
# after Runtime\ is wiped.)
|
||||
foreach ($plugin in $pluginProjects) {
|
||||
Invoke-Publish -What $plugin.DllName -Arguments @('publish', $plugin.Project, '-c', 'Release')
|
||||
if ($NativeAot) {
|
||||
Invoke-Publish -What $plugin.DllName -Arguments @('publish', $plugin.Project, '-c', 'Release')
|
||||
} else {
|
||||
# Same source, managed: loads into its own collectible context in the CoreCLR
|
||||
# engine (Plugins/ManagedPlugins.cs). Staged under out\plugins-clr, then copied.
|
||||
$stage = $plugin.Publish
|
||||
if (Test-Path -LiteralPath $stage) { Remove-Item -LiteralPath $stage -Recurse -Force }
|
||||
Invoke-Publish -What "$($plugin.DllName) (managed)" -Arguments @('publish', $plugin.Project, '-c', 'Release',
|
||||
'-p:PublishAot=false', '-p:NativeLib=', '-p:SelfContained=false', '-p:RuntimeIdentifier=win-x86',
|
||||
'-p:GenerateRuntimeConfigurationFiles=false', '-o', $stage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -256,13 +280,20 @@ if (-not $SkipLauncher) {
|
|||
Copy-FilteredChildren -Source $launcherPublish -Target $Destination -ExcludeNames @("RynthCore.App.Avalonia.exe") -ExcludeExtensions @(".pdb")
|
||||
}
|
||||
|
||||
# Engine payload to Runtime\. Skip the bundled Plugins\ subfolder - plugins
|
||||
# are deployed separately to $PluginsDestination so they have a single home.
|
||||
Copy-FilteredChildren -Source $enginePublish -Target $runtimeDir -ExcludeNames @("Plugins") -ExcludeExtensions @(".pdb")
|
||||
if ($NativeAot) {
|
||||
# Engine payload to Runtime\. Skip the bundled Plugins\ subfolder - plugins
|
||||
# are deployed separately to $PluginsDestination so they have a single home.
|
||||
Copy-FilteredChildren -Source $enginePublish -Target $runtimeDir -ExcludeNames @("Plugins") -ExcludeExtensions @(".pdb")
|
||||
|
||||
# Loader DLL - this is what RynthCore.Injector loads into acclient.exe; the
|
||||
# Loader then maps RynthCore.Engine.dll and provides hot-reload support.
|
||||
Copy-Item -LiteralPath (Join-Path $loaderPublish "RynthCore.Loader.dll") -Destination (Join-Path $runtimeDir "RynthCore.Loader.dll") -Force
|
||||
# Loader DLL - this is what RynthCore.Injector loads into acclient.exe; the
|
||||
# Loader then maps RynthCore.Engine.dll and provides hot-reload support.
|
||||
Copy-Item -LiteralPath (Join-Path $loaderPublish "RynthCore.Loader.dll") -Destination (Join-Path $runtimeDir "RynthCore.Loader.dll") -Force
|
||||
} else {
|
||||
# Native loader (native\Loader) + RynthCore.Shim + CoreCLR engine (ReadyToRun) + its
|
||||
# dependencies + Runtime\dotnet (app-local CoreCLR x86). Same contract with the
|
||||
# injector (RynthCoreInit); the loader also hosts a NativeAOT engine if one is dropped in.
|
||||
& (Join-Path $PSScriptRoot "Publish-EngineCoreClr.ps1") -Target $runtimeDir
|
||||
}
|
||||
|
||||
# SEH trampoline - small native x86 MSVC DLL providing __try/__except wrappers
|
||||
# around dangerous AC API calls so object-teardown AVs are caught instead of
|
||||
|
|
@ -302,6 +333,16 @@ foreach ($plugin in $pluginProjects) {
|
|||
New-Item -ItemType Directory -Path $pluginTargetDir -Force | Out-Null
|
||||
}
|
||||
|
||||
if (-not $NativeAot) {
|
||||
# A managed plugin is its DLL plus its dependencies (RynthCore.PluginSdk,
|
||||
# PluginCore, MoonSharp, ImGui.NET...) and pdbs; copy those, leave user data.
|
||||
foreach ($f in Get-ChildItem -LiteralPath $plugin.Publish -File | Where-Object { $_.Extension -in '.dll', '.pdb' }) {
|
||||
Copy-Item -LiteralPath $f.FullName -Destination (Join-Path $pluginTargetDir $f.Name) -Force
|
||||
}
|
||||
Write-Host "Plugin $($plugin.DllName) (managed) deployed to $pluginTargetDir"
|
||||
continue
|
||||
}
|
||||
|
||||
# Only the DLL - leave any user data (LootProfiles\, imgui.ini, etc.)
|
||||
# in place by not touching anything else under $pluginTargetDir.
|
||||
$pluginDest = Join-Path $pluginTargetDir $plugin.DllName
|
||||
|
|
@ -318,7 +359,10 @@ foreach ($plugin in $pluginProjects) {
|
|||
# Scoped pdb sweep: root + Runtime\ only. A $Destination-wide recurse walked
|
||||
# the ~1.4 GB private AcClient copy on every deploy for nothing.
|
||||
Get-ChildItem -Path $Destination -Filter *.pdb -File | Remove-Item -Force
|
||||
Get-ChildItem -Path $runtimeDir -Recurse -Filter *.pdb -File | Remove-Item -Force
|
||||
# (The CoreCLR engine's own pdbs stay: they give its stack traces line numbers.)
|
||||
Get-ChildItem -Path $runtimeDir -Recurse -Filter *.pdb -File |
|
||||
Where-Object { $NativeAot -or $_.Name -notin 'RynthCore.Engine.pdb', 'RynthCore.Shim.pdb', 'RynthCore.Loader.pdb' } |
|
||||
Remove-Item -Force
|
||||
|
||||
if (-not $SkipLauncher) {
|
||||
Write-Host "Launcher deployed to $Destination"
|
||||
|
|
|
|||
122
scripts/Publish-EngineCoreClr.ps1
Normal file
122
scripts/Publish-EngineCoreClr.ps1
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
# Publish-EngineCoreClr.ps1
|
||||
# Builds the CoreCLR-hosted engine (docs/UNLOADABLE_ENGINE_PLAN.md) and lays it out in a
|
||||
# Runtime folder:
|
||||
# RynthCore.Loader.dll native loader (native\Loader), hosts CoreCLR
|
||||
# RynthCore.Shim.dll default-ALC shim (src\RynthCore.Shim)
|
||||
# RynthCore.Engine.dll (+pdb) the engine as a managed assembly (-p:EngineHost=coreclr)
|
||||
# Avalonia*, ImGui.NET, ... the engine's managed dependencies (load into its collectible ALC)
|
||||
# cimgui, minhook, Skia, ... native libraries (process-wide, loaded once)
|
||||
# dotnet\ app-local CoreCLR x86 (from the NuGet runtime pack)
|
||||
#
|
||||
# Default target is the live install; a running client hot-reloads onto a new engine by itself:
|
||||
# .\scripts\Publish-EngineCoreClr.ps1 -> C:\Games\RynthCore\Runtime
|
||||
# .\scripts\Publish-EngineCoreClr.ps1 -Target <dir> -EngineOnly (engine + deps only: a hot reload)
|
||||
|
||||
param(
|
||||
[string]$Target = "C:\Games\RynthCore\Runtime",
|
||||
[string]$Configuration = "Release",
|
||||
[switch]$EngineOnly,
|
||||
# The engine is precompiled (ReadyToRun) unless -NoReadyToRun: each generation then
|
||||
# loads in ~130 ms instead of ~750 (less JIT); the DLL is ~5 MB instead of ~2.
|
||||
[switch]$NoReadyToRun,
|
||||
# Extra MSBuild arguments for the engine and shim builds (the installer passes -p:Version=...).
|
||||
[string[]]$MsBuildArgs = @(),
|
||||
# Deploy to the live Runtime even though status-export has commits this checkout lacks.
|
||||
[switch]$AllowBehind
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repo = Split-Path $PSScriptRoot -Parent
|
||||
|
||||
# Deploying to the live install from a checkout that lacks status-export's commits rolls
|
||||
# back other sessions' engine fixes on every running client (2026-09-29, API v70). Refuse.
|
||||
$liveRuntime = "C:\Games\RynthCore\Runtime"
|
||||
if ([IO.Path]::GetFullPath($Target).TrimEnd('\') -ieq $liveRuntime -and -not $AllowBehind) {
|
||||
git -C $repo merge-base --is-ancestor status-export HEAD 2>$null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
$missing = git -C $repo log --oneline HEAD..status-export
|
||||
throw "This checkout is missing status-export commits; deploying it to the live Runtime would roll them back:`n$($missing -join "`n")`nMerge status-export first (or pass -AllowBehind if you really mean it)."
|
||||
}
|
||||
}
|
||||
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\Installer"
|
||||
New-Item -ItemType Directory -Force -Path $Target | Out-Null
|
||||
|
||||
$stage = Join-Path $repo "out\engine-clr"
|
||||
if (Test-Path $stage) { Remove-Item $stage -Recurse -Force }
|
||||
Write-Host "Building the engine (EngineHost=coreclr)..."
|
||||
$r2r = if (-not $NoReadyToRun) { "-p:PublishReadyToRun=true" } else { "-p:PublishReadyToRun=false" }
|
||||
dotnet publish "$repo\src\RynthCore.Engine\RynthCore.Engine.csproj" -c $Configuration -p:EngineHost=coreclr $r2r -o $stage -nologo -v q @MsBuildArgs
|
||||
if ($LASTEXITCODE -ne 0) { throw "engine build failed" }
|
||||
|
||||
if (-not $EngineOnly) {
|
||||
Write-Host "Building the native loader..."
|
||||
& "$repo\native\Loader\Build-Loader.ps1"
|
||||
Write-Host "Building the shim..."
|
||||
dotnet build "$repo\src\RynthCore.Shim\RynthCore.Shim.csproj" -c $Configuration -nologo -v q @MsBuildArgs
|
||||
if ($LASTEXITCODE -ne 0) { throw "shim build failed" }
|
||||
|
||||
# The loader and the shim load once per client: a running client keeps its copy (and
|
||||
# locks the file) until it restarts. Skip them with a warning rather than fail.
|
||||
$hostFiles = @(
|
||||
"$repo\native\Loader\bin\RynthCore.Loader.dll", "$repo\native\Loader\bin\RynthCore.Loader.pdb",
|
||||
"$repo\src\RynthCore.Shim\bin\$Configuration\net10.0-windows\RynthCore.Shim.dll",
|
||||
"$repo\src\RynthCore.Shim\bin\$Configuration\net10.0-windows\RynthCore.Shim.pdb")
|
||||
# A running client holds these files; Windows lets a loaded DLL be renamed, so the old
|
||||
# copy is moved aside (the client keeps using it) and the new one goes in for the next
|
||||
# launch. Earlier moved-aside copies are deleted once no client holds them.
|
||||
Get-ChildItem $Target -Filter "RynthCore.*.old-*" -ErrorAction SilentlyContinue |
|
||||
ForEach-Object { Remove-Item $_.FullName -Force -ErrorAction SilentlyContinue }
|
||||
foreach ($f in $hostFiles) {
|
||||
$dest = Join-Path $Target (Split-Path $f -Leaf)
|
||||
try { Copy-Item $f $dest -Force -ErrorAction Stop }
|
||||
catch {
|
||||
try {
|
||||
Rename-Item $dest ("{0}.old-{1:yyyyMMddHHmmss}" -f (Split-Path $dest -Leaf), (Get-Date)) -ErrorAction Stop
|
||||
Copy-Item $f $dest -Force -ErrorAction Stop
|
||||
Write-Host "$(Split-Path $f -Leaf) was in use: moved the old one aside; new launches get the new one."
|
||||
}
|
||||
catch { Write-Warning "$(Split-Path $f -Leaf) is in use by a running client; it keeps the old one until it restarts." }
|
||||
}
|
||||
}
|
||||
|
||||
$seh = "$repo\native\SehTrampoline\bin\RynthCore.SehTrampoline.dll"
|
||||
if (-not (Test-Path $seh)) { $seh = "C:\Games\RynthCore\Runtime\RynthCore.SehTrampoline.dll" }
|
||||
$sehDest = Join-Path (Resolve-Path $Target).Path "RynthCore.SehTrampoline.dll"
|
||||
$sameSeh = (Test-Path $sehDest) -and ((Resolve-Path $seh).Path -eq $sehDest -or
|
||||
(Get-FileHash $seh).Hash -eq (Get-FileHash $sehDest).Hash)
|
||||
if (-not $sameSeh) {
|
||||
try { Copy-Item $seh $sehDest -Force -ErrorAction Stop }
|
||||
catch { Write-Warning "RynthCore.SehTrampoline.dll changed but is in use by a running client; it gets the new one when it restarts." }
|
||||
}
|
||||
|
||||
# App-local runtime: the win-x86 runtime pack the SDK restores (same version the engine was built against).
|
||||
$dotnet = Join-Path $Target "dotnet"
|
||||
if (-not (Test-Path "$dotnet\coreclr.dll")) {
|
||||
$pack = Join-Path $env:USERPROFILE ".nuget\packages\microsoft.netcore.app.runtime.win-x86"
|
||||
$ver = (Get-ChildItem $pack | Where-Object Name -like "10.*" | Sort-Object { [version]$_.Name } -Descending | Select-Object -First 1).Name
|
||||
if (-not $ver) { throw "microsoft.netcore.app.runtime.win-x86 10.x not in the NuGet cache (restore any win-x86 self-contained project once)" }
|
||||
$rt = "$pack\$ver\runtimes\win-x86"
|
||||
New-Item -ItemType Directory -Force -Path $dotnet | Out-Null
|
||||
Copy-Item "$rt\native\*" $dotnet -Force
|
||||
Copy-Item "$rt\lib\net10.0\*.dll" $dotnet -Force
|
||||
# Diagnostics-only natives the host never loads.
|
||||
Remove-Item "$dotnet\createdump.exe", "$dotnet\mscordaccore_*.dll", "$dotnet\msquic.dll" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "App-local runtime $ver -> $dotnet"
|
||||
}
|
||||
}
|
||||
|
||||
# Engine + dependencies. The canonical RynthCore.Engine.dll goes last: the loader's file
|
||||
# watcher reloads on its timestamp, so everything it needs must already be in place.
|
||||
# Only what changed. Native libraries (cimgui, Skia...) are loaded once per client and
|
||||
# locked while it runs; they rarely change, so a locked unchanged one is simply skipped.
|
||||
foreach ($f in Get-ChildItem $stage -File | Where-Object { $_.Name -notlike "RynthCore.Engine.*" -and $_.Name -ne "minhook.x86.dll" }) {
|
||||
$dest = Join-Path $Target $f.Name
|
||||
if ((Test-Path $dest) -and (Get-Item $dest).Length -eq $f.Length -and
|
||||
(Get-FileHash $dest).Hash -eq (Get-FileHash $f.FullName).Hash) { continue }
|
||||
try { Copy-Item $f.FullName $dest -Force -ErrorAction Stop }
|
||||
catch { Write-Warning "$($f.Name) changed but is in use by a running client; it gets the new one when it restarts." }
|
||||
}
|
||||
if (-not (Test-Path "$Target\minhook.x86.dll")) { Copy-Item "$stage\minhook.x86.dll" $Target -Force }
|
||||
Copy-Item "$stage\RynthCore.Engine.pdb" $Target -Force
|
||||
Copy-Item "$stage\RynthCore.Engine.dll" $Target -Force
|
||||
Write-Host "Published the CoreCLR engine to $Target"
|
||||
28
scripts/Publish-PluginsCoreClr.ps1
Normal file
28
scripts/Publish-PluginsCoreClr.ps1
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Publish-PluginsCoreClr.ps1
|
||||
# Builds RynthSuite plugins as MANAGED assemblies for the CoreCLR engine (plan Phase 4): the
|
||||
# same source as the NativeAOT build, with PublishAot off (command-line properties override
|
||||
# the csproj). Each plugin lands in its own folder with its dependencies (RynthCore.PluginSdk,
|
||||
# PluginCore, MoonSharp, ...), which the engine loads into the plugin's collectible context.
|
||||
#
|
||||
# For a test build into a separate folder; scripts\Deploy-RynthCore.ps1 is what deploys the
|
||||
# managed plugins to C:\Games\RynthSuite. The plugins reference ..\..\..\RynthCore\src\... (the
|
||||
# SDK), so they build against whatever RynthCore checkout sits next to -RynthSuite.
|
||||
# .\scripts\Publish-PluginsCoreClr.ps1 [-Plugins RynthAi,RynthChat] [-Out <dir>]
|
||||
param(
|
||||
[string]$RynthSuite = "C:\Projects\RynthSuite",
|
||||
[string]$Out = "C:\Games\RynthCore\Test\plugins-clr",
|
||||
[string[]]$Plugins = @("RynthAi", "RynthChat", "RynthNav", "RynthTracker", "RynthLua", "RynthVision")
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
foreach ($name in $Plugins) {
|
||||
$proj = Join-Path $RynthSuite "Plugins\RynthCore.Plugin.$name\RynthCore.Plugin.$name.csproj"
|
||||
if (-not (Test-Path $proj)) { Write-Warning "${name}: no project at $proj"; continue }
|
||||
$dest = Join-Path $Out $name
|
||||
if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }
|
||||
Write-Host "Building $name (managed)..."
|
||||
dotnet publish $proj -c Release -p:PublishAot=false -p:NativeLib= -p:SelfContained=false `
|
||||
-p:RuntimeIdentifier=win-x86 -p:GenerateRuntimeConfigurationFiles=false -o $dest -nologo -v q
|
||||
if ($LASTEXITCODE -ne 0) { throw "$name build failed" }
|
||||
Write-Host " -> $dest\RynthCore.Plugin.$name.dll"
|
||||
}
|
||||
62
scripts/Test-ClrReload.ps1
Normal file
62
scripts/Test-ClrReload.ps1
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Test-ClrReload.ps1 - hot-reload test for the CoreCLR-hosted engine in a throwaway client.
|
||||
#
|
||||
# Starts acclient from the private copy against -Server (default: a closed local port, so
|
||||
# nothing logs in), with its own engine.json (-Settings), reloads it -Reloads times,
|
||||
# and after each reload prints the loader/shim lines. If a generation did not unload,
|
||||
# runs tools\AlcRoots against the client to show what still holds it. Kills the client at
|
||||
# the end unless -Keep.
|
||||
param(
|
||||
[string]$Runtime = "C:\Games\RynthCore\Runtime",
|
||||
[string]$Settings = "C:\Games\RynthCore\Test\engine-noplugins.json",
|
||||
[int]$Reloads = 1,
|
||||
[int]$WarmupSeconds = 20,
|
||||
[int]$SettleSeconds = 15,
|
||||
[string[]]$ClientArgs = @("-h", "127.0.0.1", "-p", "9", "-a", "spike", "-v", "spike"),
|
||||
[switch]$Keep,
|
||||
[switch]$AlwaysRoots
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repo = Split-Path $PSScriptRoot -Parent
|
||||
$testClient = "$repo\tools\TestClient\bin\TestClient.exe"
|
||||
$alcRoots = "$repo\tools\AlcRoots\bin\Release\net10.0\win-x86\AlcRoots.exe"
|
||||
|
||||
$env:RYNTHCORE_ENGINE_SETTINGS = $Settings
|
||||
$env:RYNTHCORE_TEST_CLIENT = "Test-ClrReload" # the loader logs "TestClient: ..." (monitors skip test clients)
|
||||
# Panel layout (panel_state.txt) lives in %LOCALAPPDATA%\RynthCore and is shared with real
|
||||
# clients: a test client gets its own so it never moves the player's bar or panels.
|
||||
$env:LOCALAPPDATA = "C:\Games\RynthCore\Test\localappdata"
|
||||
New-Item -ItemType Directory -Force $env:LOCALAPPDATA | Out-Null
|
||||
$out = & $testClient "C:\Games\RynthCore\AcClient\acclient.exe" "$Runtime\RynthCore.Loader.dll" RynthCoreInit 0 @ClientArgs
|
||||
$clientPid = [int](($out | Select-String "TEST_PID=(\d+)").Matches[0].Groups[1].Value)
|
||||
$log = "C:\Games\RynthCore\Logs\RynthCore.$clientPid.log"
|
||||
Write-Host "client pid $clientPid, log $log"
|
||||
Start-Sleep $WarmupSeconds
|
||||
|
||||
$seen = 0
|
||||
function Show-NewLoaderLines {
|
||||
$lines = @(Get-Content $log | Select-String "\[loader\]|\[ERR\]|\[WRN\]")
|
||||
$lines[$script:seen..($lines.Count - 1)] | ForEach-Object { $_.Line }
|
||||
$script:seen = $lines.Count
|
||||
}
|
||||
Show-NewLoaderLines
|
||||
|
||||
for ($i = 1; $i -le $Reloads; $i++) {
|
||||
if (-not (Get-Process -Id $clientPid -ErrorAction SilentlyContinue)) { Write-Host "client died"; break }
|
||||
Write-Host "---- reload $i"
|
||||
$ev = [System.Threading.EventWaitHandle]::OpenExisting("Local\RynthCore.Engine.RequestReload.p$clientPid")
|
||||
[void]$ev.Set()
|
||||
$ev.Dispose()
|
||||
Start-Sleep $SettleSeconds
|
||||
Show-NewLoaderLines
|
||||
$notFreed = Select-String -Path $log -Pattern "NOT unloaded" -Quiet
|
||||
if ($AlwaysRoots -or ($notFreed -and $i -eq 1)) {
|
||||
Write-Host "---- AlcRoots"
|
||||
& $alcRoots $clientPid 30
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $Keep) {
|
||||
Stop-Process -Id $clientPid -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "client $clientPid stopped"
|
||||
}
|
||||
97
scripts/Test-ClrWorld.ps1
Normal file
97
scripts/Test-ClrWorld.ps1
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
# Test-ClrWorld.ps1 - logs a test character into a LOCAL server with the CoreCLR engine and
|
||||
# hot-reloads it N times, reporting per generation: unloaded or not, pattern misses, hangs,
|
||||
# and the frame rate afterwards. Runs tools\AlcRoots when a generation doesn't unload.
|
||||
#
|
||||
# Uses the injector's headless --launch with a saved account profile (the password stays in
|
||||
# the launcher's settings). Only point it at a server you run yourself.
|
||||
# .\scripts\Test-ClrWorld.ps1 -Account Buffi -Server ACEmulator -Character "+Buffi" -Reloads 5
|
||||
param(
|
||||
[string]$Account = "Buffi",
|
||||
[string]$Server = "ACEmulator",
|
||||
[string]$Character = "+Buffi",
|
||||
[string]$Runtime = "C:\Games\RynthCore\Runtime",
|
||||
[string]$Settings = "C:\Games\RynthCore\Test\engine-plugins.json",
|
||||
[int]$Reloads = 3,
|
||||
[int]$WarmupSeconds = 45,
|
||||
[int]$SettleSeconds = 25,
|
||||
# Chat commands to run after login and again after every reload (through the test
|
||||
# client's own dispatch file), e.g. "/rc ui popout Radar".
|
||||
[string[]]$Commands = @(),
|
||||
[switch]$Keep
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repo = Split-Path $PSScriptRoot -Parent
|
||||
$injector = "$repo\out\injector\RynthCore.Injector.exe"
|
||||
if (-not (Test-Path $injector)) {
|
||||
dotnet publish "$repo\src\RynthCore.Injector\RynthCore.Injector.csproj" -c Release -o "$repo\out\injector" -nologo -v q | Out-Null
|
||||
if (-not (Test-Path $injector)) { throw "could not build the injector" }
|
||||
}
|
||||
$alcRoots = "$repo\tools\AlcRoots\bin\Release\net10.0\win-x86\AlcRoots.exe"
|
||||
$pidFile = "C:\Games\RynthCore\Test\current-pid.txt"
|
||||
|
||||
# A client killed without logging off keeps its session on the server for about a minute.
|
||||
if (Test-Path $pidFile) {
|
||||
$old = [int](Get-Content $pidFile)
|
||||
if (Get-Process -Id $old -ErrorAction SilentlyContinue) {
|
||||
Stop-Process -Id $old -Force
|
||||
Write-Host "stopped previous test client $old; waiting 65 s for the server to drop its session"
|
||||
Start-Sleep 65
|
||||
}
|
||||
}
|
||||
|
||||
$env:RYNTHCORE_ENGINE_SETTINGS = $Settings
|
||||
$env:RYNTHCORE_TEST_CLIENT = "Test-ClrWorld" # the loader logs "TestClient: ..." (monitors skip test clients)
|
||||
# Panel layout (panel_state.txt) lives in %LOCALAPPDATA%\RynthCore and is shared with real
|
||||
# clients: a test client gets its own so it never moves the player's bar or panels.
|
||||
$env:LOCALAPPDATA = "C:\Games\RynthCore\Test\localappdata"
|
||||
New-Item -ItemType Directory -Force $env:LOCALAPPDATA | Out-Null
|
||||
$dispatch = "C:\Games\RynthCore\Test\dispatch.txt"
|
||||
$env:RYNTHCORE_DISPATCH_FILE = $dispatch
|
||||
Set-Content $dispatch "# test dispatch file"
|
||||
function Send-Commands {
|
||||
foreach ($c in $Commands) {
|
||||
Set-Content $dispatch "force:$c"
|
||||
Start-Sleep 2
|
||||
}
|
||||
}
|
||||
$out = & $injector --launch --account $Account --server $Server --engine "$Runtime\RynthCore.Loader.dll" --character $Character 2>&1
|
||||
$clientPid = [int](($out | Select-String "LAUNCHED_PID=(\d+)").Matches[0].Groups[1].Value)
|
||||
Set-Content $pidFile $clientPid
|
||||
$log = "C:\Games\RynthCore\Logs\RynthCore.$clientPid.log"
|
||||
Write-Host "client $clientPid, log $log"
|
||||
Start-Sleep $WarmupSeconds
|
||||
|
||||
function Summarize([int]$from) {
|
||||
$lines = @(Get-Content $log | Select-Object -Skip $from)
|
||||
$lines | Select-String "unloaded in|NOT unloaded|unloaded since|Reload: |PATTERN MISS|HANG DETECTED|prologue not found|\[ERR\]|still running|ChatFileDispatcher: dispatching|PopOut|pop-out" |
|
||||
ForEach-Object { Write-Host (" " + ($_.Line -replace '^\[(\S+)\] \[pid:\d+\] ', '$1 ')) }
|
||||
$fps = $lines | Select-String "hb #\d+ .*fps=(\d+).*login=(\d)" | Select-Object -Last 8 |
|
||||
ForEach-Object { $_.Matches[0].Groups[1].Value }
|
||||
Write-Host " fps (last 8 heartbeats): $($fps -join ' ')"
|
||||
return (Get-Content $log).Count
|
||||
}
|
||||
|
||||
Send-Commands
|
||||
Start-Sleep 5
|
||||
$mark = 0
|
||||
Write-Host "---- gen 1"
|
||||
$mark = Summarize $mark
|
||||
for ($i = 1; $i -le $Reloads; $i++) {
|
||||
if (-not (Get-Process -Id $clientPid -ErrorAction SilentlyContinue)) { Write-Host "CLIENT DIED"; break }
|
||||
Write-Host "---- reload $i"
|
||||
$ev = [System.Threading.EventWaitHandle]::OpenExisting("Local\RynthCore.Engine.RequestReload.p$clientPid")
|
||||
[void]$ev.Set(); $ev.Dispose()
|
||||
Start-Sleep $SettleSeconds
|
||||
Send-Commands
|
||||
Start-Sleep 5
|
||||
$before = $mark
|
||||
$mark = Summarize $mark
|
||||
if (Get-Content $log | Select-Object -Skip $before | Select-String "NOT unloaded" -Quiet) {
|
||||
Write-Host "---- AlcRoots"
|
||||
& $alcRoots $clientPid 15
|
||||
}
|
||||
}
|
||||
$p = Get-Process -Id $clientPid -ErrorAction SilentlyContinue
|
||||
Write-Host ("client " + $(if ($p) { "alive, responding=$($p.Responding)" } else { "DEAD" }))
|
||||
if (-not $Keep -and $p) { Stop-Process -Id $clientPid -Force; Write-Host "client stopped" }
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
# (MaybeRestartWedgedClients), so it can run with the launcher closed:
|
||||
#
|
||||
# * fps=0 with login=1 sustained >= WedgeHoldSeconds (render dead, alive)
|
||||
# * main-thread queue qd > QueueWedgeDepth with login=1 (queue not draining)
|
||||
# * (inert since 2026-10-01: the engine reports qdrop, a running total of dropped
|
||||
# actions, not a queue depth; healthy clients were being killed on it)
|
||||
# * combat-mode "stuck Ns" >= StanceStuckSeconds (item-action hard-lock)
|
||||
# * heartbeat file silent > HbStaleSeconds while alive (engine died in-proc)
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in a new issue