Battlekeeper / Arma3PerformanceExtension

5 stars 2 forks source link

Headless Client Disconnecting&Reconnecting Mid-Mission Will Leave Players with Hidden Objects. #7

Open CalebSerafin opened 2 years ago

CalebSerafin commented 2 years ago

Problem

Once the A3PE_HCOverride has been set. It will not be un-set until a mission restart. https://github.com/Battlekeeper/Arma3PerformanceExtension/blob/b67f011804500c9083752ac65fe3cd13bf30198b/addons/A3PE/functions/A3PEInit.sqf#L42 This will be an issue if the headless client decides to disconnect and reconnect mid-mission (An occurrence sometimes noticed on the Antistasi Offical servers). After the headless client leaves, the server will not take over as the A3PE_HCOverride is true and the server loop would have exited. When the headless client reconnects, it will not take over as A3PE_HCOverride would still be true.

Suggestion

  1. Make a server loop run in the background
  2. If it detects that A3PE_HCOverride is true and that the clienID in A3PE_HCNetworkID is not connected.
  3. Set A3PE_HCOverride to false and restart the server process. Or try to find another connected Headless client and re-execute the init script on them so that they will take over.

Work-Around

The mission hoster or admins should know that this can happen. In that case, they should instruct all players to toggle their Performance addon off so that the objects will be visible again. However, players will no longer benefit from the previous performance gains.

DeliciousJaffa commented 2 years ago

Use of PlayerDisconnected mission event handler would be able to detect disconnection of a HC and avoid adding additional loops