Page MenuHomeFeedback Tracker

Handledisconnect still kills unit if player is in a group with another player
Acknowledged, WishlistPublic


This is an annoying issue that I've been trying to track down for awhile. The handledisconnect eventhandler does not work as expected if the unit that disconnects is in the group of a another player as the unit will transfer to the players client and not the server and will promptly kill the AI. It stops the body from sinking into the ground but the unit will be killed and the player cannot retake the slot as expected. You can easily work around this issue by using something like:

addMissionEventHandler ["HandleDisconnect",{_unit = _this select 0; diag_log format ["%1 Disconnected! Hopefully saving their unit!",_unit]; [_unit] join grpnull; _unit disableAI "AUTOTARGET";_unit disableAI "TARGET";_unit disableAI "MOVE";_unit disableAI "FSM";true}];

Which will make the unit leave the group when the player disconnects, preserving the unit. But this also has the side effect that if the player reconnects, it will create a clone rather than take over the existing unit! This must be because the engine cannot find the unit in the group any more.


Legacy ID
Steps To Reproduce

First the eventhandler has to be set on the server, this will work fine:
addMissionEventHandler ["HandleDisconnect",{true}];

AI must be disabled for this to work!

  1. Have two players on a dedicated server (or at least both be dedicated clients and not the listen server)
  2. Have both players in the same group with the player disconnecting being a subordinate
  3. Have the subordinate player disconnect, note how AI takes over for a brief moment before the players unit immediately falls over dead. This will only happen in a group that is local to another player, if the player is in its own group it behaves as expected (preserves the unit)

Event Timeline

KercKasha edited Steps To Reproduce. (Show Details)Feb 7 2015, 3:16 PM
KercKasha edited Additional Information. (Show Details)
KercKasha set Category to Multiplayer.
KercKasha set Reproducibility to Always.
KercKasha set Severity to None.
KercKasha set Resolution to Open.
KercKasha set Legacy ID to 2649553392.May 7 2016, 8:14 PM
KercKasha edited a custom field.
Bohemia added a subscriber: Dwarden.Feb 7 2015, 3:16 PM

can you please try DEV branch 1.39.129234 or newer,
can't replicate the issue on it

Sorry for not replying sooner, i can confirm this issue exists in 1.40 stable still.

Haven't tested in dev 1.41 will try that soon

This continues to be an issue in 1.50

Still an issue, seems to be any locality change that kills the unit.

My reproduction steps:

  1. In Editor, add the HandleDisconnect handler to the mission init, returning true.
  2. Disable AI on the mission in Attributes > Multiplayer.
  3. Add a few playable slots and start the mission in multiplayer.
  4. Connect as a client in another instance.
  5. After beginning the mission, disconnect the client.
  6. Rejoin as the third slot on the client.
  7. Use the setOwner or setGroupOwner command on the server to change the AI's locality to the client.