@AgentRev @SaMatra My bad, looks like the server events are only for internal use and they are not accessible by scripts. I've found the onPlayerDisconnected, that is basically a simple script code directly called when the player is disconnected.
One more question about the killing the unit:
Current behavior works like this:
When the player disconnects, the controlled unit is released (switched to AI) and all local units has to be transfered (locality has to be moved) to other machine (server). The target machine accepts the units, making them local. Then each unit is checked if it's playable unit and AI is disabled, then this unit is killed and removed.
The first part can't be changed, unit has to be local somewhere (somebody has to be responsible for simulation/updates etc.) so what I have done is that I've added an event handler before the last part when the unit is checked for playable/AI (before the unit is killed/removed). If the handler returns false, then it's processed as normal (killed/removed if AI disabled, left in scene when AI is allowed). My question is what should happen when the event handler returns true.
The advantage of the 1. is that handler has full control over the unit, disadvantage is that this allow an AI controlled unit when this is strictly disabled in the role selection/description.ext.
Which one of these two options is acceptable? Do you prefer any other option?