Fix multiplayer crash when a remote client controls an opponent#11006
Open
MostCromulent wants to merge 1 commit into
Open
Fix multiplayer crash when a remote client controls an opponent#11006MostCromulent wants to merge 1 commit into
MostCromulent wants to merge 1 commit into
Conversation
Control-an-opponent effects (e.g. Secret of Bloodbending) crashed the game in multiplayer when the controlling player was a remote client. The controlled player's priority is driven through the controller's shared InputProxy, so InputProxy.update calls setCurrentPlayer on the controller's GUI. On the host that GUI is a CMatchUI whose FControlGameEventHandler registers the controlled player as local when GameEventPlayerControl fires, so the call succeeds. The server-side RemoteClientGuiGame instead uses a GameEventForwarder that only relays events to the client and never updates its own gameControllers map, so setCurrentPlayer threw IllegalArgumentException and killed the game thread. Mirror the host-side bookkeeping in RemoteClientGuiGame: on each GameEventPlayerControl, register or unregister the controlled player in the proxy's gameControllers. Identify the controller via the controlled player's mind-slave master and isLocalPlayer rather than by name, so only the actual controller's proxy registers the player. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Control-an-opponent effects (e.g. Secret of Bloodbending) crash the game in multiplayer when the controlling player is a remote client. Reproduction: in a network game, the remote client casts Secret of Bloodbending targeting the host; the game thread dies with
IllegalArgumentExceptionatAbstractGuiGame.setCurrentPlayeras soon as control takes effect on the host's turn.Root cause: the controlled player's priority runs through the controller's shared
InputProxy, soInputProxy.updatecallssetCurrentPlayeron the controller's GUI. On the host, that GUI'sFControlGameEventHandlerregisters the controlled player as local whenGameEventPlayerControlfires, so the call succeeds. The server-sideRemoteClientGuiGameinstead uses aGameEventForwarderthat only relays events to the client and never updates its owngameControllersmap — so the controlled player is never registered server-side andsetCurrentPlayerthrows.The fix mirrors the host-side bookkeeping in
RemoteClientGuiGame: on eachGameEventPlayerControl, register or unregister the controlled player in the proxy'sgameControllers, identifying the controller via the controlled player's mind-slave master andisLocalPlayer(not by name) so only the actual controller's proxy registers the player.🤖 Generated with Claude Code