Skip to content

Add Slay the Spire 2 v0.110.1 compatibility - #1

Draft
PageSecOnd wants to merge 20 commits into
masterfrom
agent/sts2-0.110.1-compat
Draft

Add Slay the Spire 2 v0.110.1 compatibility#1
PageSecOnd wants to merge 20 commits into
masterfrom
agent/sts2-0.110.1-compat

Conversation

@PageSecOnd

@PageSecOnd PageSecOnd commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adapt LAN Multiplayer Reforged to Slay the Spire 2 v0.110.1 API and runtime scene changes identified from the v0.110.1 game assembly, local builds, and in-game logs.

Root cause

STS2 v0.110.x refactored lobby player state. The old LobbyPlayer type was split into StartRunLobbyPlayer, LoadRunLobbyPlayer, and RunLobbyPlayer, RunLobby now receives IEnumerable<RunLobbyPlayer>, and lobby player serialization now includes PeerVersionInfo. The old mod therefore returned a null constructor from RunLobbyConstructorPatchs.TargetMethods() and also referenced a type that no longer exists.

Additional compile-time API changes found by building against v0.110.1:

  • JoinFlow.NetService is now exposed as INetClientGameService, while the LAN player-name helper still required concrete NetClientGameService.
  • NControllerManager.IsUsingController was removed; controller state is now represented by NControllerManager.InputType / InputType.Controller.

Runtime testing also found a join-screen scene-layout change:

  • JoinButton.Create() assumed ControllerIcon was a direct child of the copied refresh button. In v0.110.1 the vanilla scene references it as a unique node (%ControllerIcon), and the old hard-coded direct lookup threw during the Harmony _Ready prefix. That interrupted vanilla _Ready, which then caused NJoinFriendScreen.OnSubmenuOpened() to throw and left the join screen blank.

Changes

  • Update the RunLobby constructor Harmony target to use IEnumerable<RunLobbyPlayer>.
  • Patch StartRunLobbyPlayer.Serialize/Deserialize instead of removed LobbyPlayer.
  • Preserve the mod's VarInt slot encoding while adding v0.110.x PeerVersionInfo serialization/deserialization in the correct packet order.
  • Update ClientLobbyJoinResponseMessage and LobbyBeginRunMessage list deserialization to StartRunLobbyPlayer.
  • Replace removed RunLobby.ConnectedPlayerIds usage with RunLobby.PlayerIds.
  • Replace removed LoadRunLobby.ConnectedPlayerIds counting with LoadRunLobby.PlayerCount.
  • Change LAN player-name negotiation to accept INetClientGameService.
  • Replace removed IsUsingController calls with InputType == InputType.Controller.
  • Preserve and surface StartENetHost errors instead of discarding its return value.
  • Make the copied LAN join button find ControllerIcon recursively and restore owners for duplicated descendants so unique-node lookups remain usable.
  • Move LAN join-screen injection from a Harmony _Ready prefix to a postfix and make key scene lookups tolerant, so LAN UI failures no longer prevent the vanilla join screen from initializing.

Validation

Static compatibility review was performed against the supplied STS2 v0.110.1 sts2.dll metadata. The affected types, namespaces, fields, interfaces, enum values, and target method/property names were checked directly against that assembly.

A first local build with .NET 9.0.316 against the v0.110.1 game files exposed six API errors (three INetClientGameService conversion errors and three removed IsUsingController references); those were addressed.

A subsequent in-game run showed the mod now completes initialization, but entering the join screen failed at JoinButton.Create() because ControllerIcon is no longer a direct child. That runtime failure and the resulting blank-screen cascade are addressed by the latest commits.

The PR remains a draft pending another local build and in-game join/host verification.

Expected impact

This should remove the original Harmony initialization failure, eliminate the known stale lobby-player API references, address the compile errors reported against v0.110.1, and restore the LAN join panel without breaking the vanilla join screen when the UI scene layout changes.

@PageSecOnd
PageSecOnd force-pushed the agent/sts2-0.110.1-compat branch from 053a0e4 to 7f5af9d Compare August 10, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant