Page MenuHomeFeedback Tracker

1.66 HandleDisconnect event does not fire on MP disconnects
Closed, ResolvedPublic


Perhaps related to

This is new to 1.66.

When players disconnect MP missions, their bodies become AI, even with disabledAI = 1; in description.ext. This seems related to using selectPlayer to move a player into a new character.

The HandleDisconnect event is not firing in this case, so scripts are not informed of disconnects for cleanup tasks.


Operating System
Windows 7
Steps To Reproduce

addMissionEventHandler ["HandleDisconnect", { diag_log "Fired"; false}];

This event won't fire, and the abandoned body becomes AI - it does not die.

Event Timeline

Stormridge updated the task description. (Show Details)Dec 2 2016, 6:03 AM
Stormridge updated the task description. (Show Details)Dec 2 2016, 6:05 AM
He-Man added a subscriber: He-Man.Dec 2 2016, 2:29 PM

Can confirm this!

vbawol added a subscriber: vbawol.Dec 2 2016, 3:02 PM

addMissionEventHandler ['PlayerDisconnected',{

seems to work tho :)

Torndeco added a subscriber: Torndeco.EditedDec 2 2016, 3:49 PM

Yes this is the exact same issue that occurred in previous arma version perf build 1.
Which was reverted

The eventhandler never fires and ai unit takes over.

Depending on your test mission, when you reconnect in the same slot player will take over the ai unit.
Might explain how it missed QA Testing ;)

This is also occurs in the latest dev branch

razazel claimed this task.Dec 2 2016, 3:57 PM
razazel changed the task status from New to Need More Info.
razazel added a subscriber: razazel.


yet again, I am unfortunately unable to reproduce this.

Would you mind to upload a simple repro mission (as simple as possible) that could demonstrate the issue?
I have tried to create a simple repro mission

4 Playable units


addMissionEventHandler ["HandleDisconnect", { diag_log "Fired"; false}];


disabledAI = 1;

Connected with 2 players, one disconnected afterwards.

"Fired" was correctly logged in the RPT file of the server. Player 2 unit died, AI did not take over.

If you can please try to provide the repro mission or fill in possible blanks in my repro mission.

Thank you

Could it be that this is also related to "selectPlayer"? Switch from the unit you get from the lobby slot to another and then disconnect.

Dwarden added a subscriber: Dwarden.Dec 2 2016, 4:00 PM

selectPlayer must be used to transfer the player to a new body. Then all these new open issues reproduce.

Will try this, thanks for that :)

razazel changed the task status from Need More Info to Reviewed.Dec 2 2016, 4:22 PM

Got a repro, thanks a lot for your help guys ;)

Capu added a subscriber: Capu.Dec 2 2016, 5:16 PM

More specifically, if the original player-assigned body is deleted (using deleteVehicle) the server stops receiving disconnect events from the player and their new body.

However, if the original body is kept around (usually this is a virtual or invisible body) the disconnect events propagate correctly.

mubby added a subscriber: mubby.Dec 2 2016, 5:41 PM
Stormridge added a comment.EditedDec 2 2016, 6:04 PM

Here's a repro Altis mission. Mod for server and client included.

Run server with client+server mod.
Run client with client mod.
Join server.
After joining and receiving a body, Disconnect. (do not respawn)
Look at server rpt logs - You should see a Disconnect event logged.

Look at client code in Init\fn_preInit.sqf
If you comment/uncomment the deleteVehicle line, you can affect the behavior of the disconnect event.

After the client disconnect, also note that the player's body is AI. It should have been killed / freed up by the server due to the DisableAI setting. But the zombie remains.

truemc added a subscriber: truemc.Dec 2 2016, 6:35 PM
GvKlinky added a subscriber: GvKlinky.EditedDec 2 2016, 10:22 PM

And when i come back in my server, i can look myself in the face, and say hello.....

It's annoying, players become AI's after leaving the server. And when a player dies, he sees a blurry screen, even when he re-spawns.
after re-spawn, the player has to leave the server, and restart the game to see normal again.
This reconnection results in a new AI after leaving .........

(this is me looking at myself.... or is this my twin brother?)

After update 1.66 the loading screen also changed....
I only host exile: Altis, but the loading screens shows: Tanoa

This was the first issue i noticed after the patch 1.66

PAR4NA added a subscriber: PAR4NA.Dec 2 2016, 10:25 PM
This comment was removed by Stormridge.

Probably obvious, but the allPlayers list is incorrect after a player dies and respawns into spectator after this. The player that dies or respawns into spectator has their UID empty, and their name is ERROR: No unit.

This is causing our system to kick spectators because their player information appears invalid. (they have no UID and no name)

GvKlinky removed a subscriber: GvKlinky.Dec 3 2016, 9:53 AM
razazel changed the task status from Reviewed to Feedback.Dec 8 2016, 4:27 PM

Should be fixed in new hotfix, can you confirm?

Yes, this is working now.

razazel closed this task as Resolved.Dec 9 2016, 9:31 AM