迁移到 Reforge 无 Harmony 重写版并修复 beta 兼容问题和超过 7 人无法联机问题 - #23
Open
zuiter wants to merge 6 commits into
Open
Conversation
Replace the old runtime-patching implementation with the Reforge module system: official mod initializer, reflection cache, injected Godot nodes, and the RMP extended lobby protocol for large-lobby synchronization. The migration also refreshes player-facing README content, restores screenshot assets and contributor credits, removes tracked build outputs, and teaches release scripts to resolve both sts2.dll and Steamworks.NET.dll from the installed game. Constraint: Current project rules forbid Harmony, MonoMod, runtime transpilers, and JSON config files. Constraint: Slay the Spire 2 beta 0.106.1 requires INetMessage.ShouldBuffer to be compiled against the current game assembly. Rejected: Patch the old Harmony implementation in place | this PR is intentionally the Reforge migration requested by maintainers. Rejected: Commit generated DLL/PCK/ZIP artifacts | build outputs are reproducible and already ignored. Confidence: medium Scope-risk: broad Directive: Do not reintroduce runtime patching frameworks; keep game-internal access behind ReflectionCache and RMP protocol boundaries. Tested: dotnet build .\RemoveMultiplayerPlayerLimit.csproj -c Release with installed beta sts2.dll and Steamworks.NET.dll Tested: powershell -ExecutionPolicy Bypass -File tools\build_release.ps1 -Configuration Release -Sts2AssemblyPath <installed sts2.dll> -SteamworksAssemblyPath <installed Steamworks.NET.dll> Tested: git diff --cached --check Not-tested: In-game multiplayer session with 5-16 real clients
zuiter
force-pushed
the
reforge-migration-0.1.8-beta
branch
from
May 27, 2026 10:59
7666149 to
e6670c9
Compare
The current game renamed StartRunLobby's private beginning-run flag and still serializes vanilla lobby player slot IDs with two bits. If RMP's button rewiring misses the original ready callback, five-plus-player lobbies can fall back to the vanilla ready/start path and fail to start correctly until the lobby drops back to four players. The fix keeps the beginning-run reflection compatible with the new field name, disconnects vanilla ready button callbacks by inspecting the signal connection list, and adds a host-side extended-start retry while the lobby is active. Constraint: Do not change version numbers for 0.1.8-beta Constraint: Keep the Reforge migration free of Harmony, MonoMod, PatchAll, and runtime method replacement Rejected: Rely only on periodic host polling | host-local vanilla ready can run before the polling tick when the host is the last ready player Confidence: medium Scope-risk: narrow Directive: Do not route five-plus-player begin-run through vanilla LobbyBeginRunMessage because LobbyPlayer.slotId still serializes with two bits Tested: dotnet build Release against Slay the Spire 2 v0.107.1 assemblies Tested: tools/build_release.ps1 with Godot 4.5.1 generated build/sts2-RMP-0.1.8-beta.zip Not-tested: Real five-plus-player multiplayer lobby after the game update
The build has moved out of the beta-suffixed package name, so the manifest, startup log, readmes, and changelog headings now use 0.1.8. The release script derives the archive name from the manifest version, producing sts2-RMP-0.1.8.zip. Constraint: User explicitly requested renaming the version to 0.1.8 Scope-risk: narrow Confidence: high Tested: dotnet build Release against current Slay the Spire 2 assemblies Tested: tools/build_release.ps1 generated build/sts2-RMP-0.1.8.zip Not-tested: Real multiplayer session with the renamed package
The extended lobby snapshot now adopts the host's complete player order before notifying listeners, preventing peers from retaining divergent lobby ordering. The English and Chinese READMEs now describe 0.1.8 as the formal Reforge release and record its v0.107.1/v0.108.0 compatibility status. Constraint: Version must remain 0.1.8 and the shared protocol must stay compatible with v0.107.1 Rejected: Add a v0.108-only implementation branch | current game contracts and the RMP wire format remain compatible Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep lobby.Players in host snapshot order before dispatching connection or state-change callbacks Tested: Full Release package build against v0.108.0; reflection contract checker; PCK cover load; git diff --cached --check Not-tested: Live 5-16 player multiplayer session; final DLL launch after switching the installed game back to v0.107.1
Slay the Spire 2 v0.109.0 can connect the vanilla ready callbacks after RMP's first screen pass, routing extended-slot readiness through the unsafe vanilla protocol. Maintain stable RMP callables continuously, isolate each maintenance lane, and support the settings panel's new reflection signature while retaining older behavior. Constraint: Keep the mod version at 0.1.8 Constraint: Preserve compatibility with v0.107.1 and v0.108.0 without changing the extended lobby wire format Constraint: Keep the Reforge build free of Harmony, MonoMod, transpilers, and runtime method replacement Rejected: Patch each lobby screen only once | v0.109.0 screen initialization can reconnect vanilla callbacks after that pass Confidence: high Scope-risk: narrow Reversibility: clean Directive: Do not route 5+ player ready or begin-run flow through vanilla LobbyBeginRunMessage because LobbyPlayer.slotId remains two-bit serialized Tested: dotnet build Release against Slay the Spire 2 v0.109.0 assemblies with zero warnings and errors Tested: reflection compatibility check passed against v0.109.0 commit c12f634d Tested: tools/build_release.ps1 generated build/sts2-RMP-0.1.8.zip Tested: launched v0.109.0 to main menu; RMP initialized and logged active ready-handler maintenance without RMP exceptions Not-tested: Real five-plus-player multiplayer session
Player logs from v0.109.0 showed the extended begin-run path bypassing vanilla message buffering while repeated lobby snapshots disposed PeerInputSynchronizer through remote cursor reinitialization. Match the vanilla transition order and leave cursor synchronizer lifecycle to the lobby screens that own it. Constraint: Version remains 0.1.8 and protocol v2 remains unchanged for v0.107.1 compatibility Rejected: Reinitialize the remote cursor container after each snapshot | the game disposes the synchronizer and unregisters its PeerInputMessage handler Confidence: high Scope-risk: narrow Directive: Do not initialize the remote cursor container from the snapshot path without first proving the existing synchronizer will not be disposed Tested: v0.109.0 Release build (0 warnings, 0 errors); reflection and compiled-IL call-order checks; full 0.1.8 release package; main-menu startup Not-tested: Real 5+ player multiplayer run; v0.107.1 runtime on a live client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改内容
本 PR 将旧的 Harmony 实现迁移为 Reforge 无 Harmony 重写版。
主要改动:
ModInitializer+ReflectionCache+ Godot 节点模块INetMessage.ShouldBuffer导致的模组加载失败README.md/README_ZH.md,保留截图、功能说明、配置说明和鸣谢build/二进制产物sts2.dll和Steamworks.NET.dll说明
Reforge 版本不再使用 Harmony / MonoMod / Transpiler,也不再依赖运行时方法替换。
当前实现通过游戏自带的 Mod 初始化入口加载模块,并使用反射缓存、Godot 节点轮询和 RMP 扩展网络协议来处理多人大厅、UI 布局、宝箱房和难度缩放等功能。
0.1.8-beta中房间人数上限固定为 16,旧配置中的max_player_limit会被忽略;配置文件仅保留difficulty_scaling和 macOS TLS 兼容补丁相关选项。已验证
dotnet build .\RemoveMultiplayerPlayerLimit.csproj -c Release通过tools/build_release.ps1完整打包通过sts2-RMP-0.1.8-beta.zipgit diff --cached --check通过.csproj中没有 Harmony / MonoMod patch 引用未验证