In the last weeks i played many online coop-missions. Some mapmakers told me about problems that can occur in their mission, if a player disconnects during a running game. Maybe their AI is giving confusing orders then, or the other players have problems to meet the objectives and finish the mission.
I developed a script set, that is able to detect a disconnected player. It works best for coop-missions with disabled AI by default, because it expects every to the script passed unit as human. It will execute the onPlayerDisconnected script for every disconnected player once, synchronized, on the server and all the clients that are running the mission. It cannot detect disconnection immediatly, but at least it detects after a certain time period.
I know, there are methods to detect disconnection with the locality to the server. But if the players are grouped together, this method will not have success. I am using a global value sended via publicvariable to the server, like a ping. The server expects that value to be present after a certain time period. If not, it will count the player as disconnected and will execute onPlayerDisconnected for the related unit.
I would like to hear your opinion, and will take suggestions or answer questions here.
Credits for ideas, helping and testing to:
Jumper8
Mantel
Edit: don�t be confused about the readme... Mad Max is equal to dr. seltsam
Get onPlayerDisconnected v0.922