You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need to implement some logic to do gentle/soft handover of the Multiplayer Mutex.
Recommended strategy:
Register the shared dataref xplanemp/want_planes as an int.
Acquiring Planes:
write our PluginID to the shared dataref xplanemp/want_planes
Try to get the XPLMAcquirePlanes with a registered callback for late acquisition.
if the aquisition was successful:
complete the setup steps that require the plane mutex (tcas callbacks, etc)
Releasing Planes:
get the value of xplanemp/want_planes
disable our XPMP Planes dependent callbacks
XPLMReleasePlanes
if the value of the dataref is our plugin ID:
set the dataref to 0 (or -1 if 0 is a valid plugin ID)
deferred aquisition callback:
Get the value of xplanemp/want_planes
if the value of the dataref is our plugin_id:
make an XPLMAcquirePlanes call
complete the setup steps for the plane mutex
shared dataref update callback:
Get the value of xplanemp/want_planes
if the value of the dataref is NOT our plugin_id and not 0 (or -1 per above) and we have the mutex:
disable our XPMP Planes dependent callbacks
XPLMReleasePlanes
This approach should allow multiple xplanemp consumers to hand off the plane mutex to the most recently invoked tool, rather than holding onto it. For plugins that want to voluntarily take the lowest precedence and not have explicit enable steps, they can monitor for the 0/-1 value in xplanemp/want_planes and use that as a cue to take ownership.
The text was updated successfully, but these errors were encountered:
Need to implement some logic to do gentle/soft handover of the Multiplayer Mutex.
Recommended strategy:
Register the shared dataref
xplanemp/want_planes
as an int.Acquiring Planes:
xplanemp/want_planes
Releasing Planes:
xplanemp/want_planes
deferred aquisition callback:
xplanemp/want_planes
shared dataref update callback:
xplanemp/want_planes
This approach should allow multiple xplanemp consumers to hand off the plane mutex to the most recently invoked tool, rather than holding onto it. For plugins that want to voluntarily take the lowest precedence and not have explicit enable steps, they can monitor for the 0/-1 value in
xplanemp/want_planes
and use that as a cue to take ownership.The text was updated successfully, but these errors were encountered: