Repository navigation
Native outputs for player plugins - #49
Merged
Merged
Conversation
Implements IGamelogicNativeOutputs, so player plugins such as the B2S backglass receive every light and coil MPF drives, mapped or not. - Numbering: coils use their MPF config number when it is a plain integer. Lights of subtype `light` are lamps and `gi` lights are GI strings, both with their config number. Hardware addresses that aren't plain integers (FAST, P-ROC, OPP styles) and other light subtypes are reported with number -1 rather than a guessed number. - Values: lights are physical brightness 0..1, following MPF's fades. Coils are on/off, from enable or pulse until disable or the pulse's end. - Hardware rules (flippers, slings, pops) are reported from the switch changes that fire them. Removing a rule, as on a tilt, releases what it held. - Commands from the gRPC threads are timestamped and applied in order once per frame on the main thread, with no allocation in steady state. Detaching drops anything still queued.
|
The dispatch sink kept a reference to the last listener after SetNativeOutputListener(null), keeping an unloaded plugin alive until the engine was destroyed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets player plugins, such as the B2S backglass, see every light and coil MPF drives, including lights the playfield doesn't map. Requires the plugin contracts from VisualPinball.Engine
feat/player-plugins(freezy/VisualPinball.Engine#588).Numbering: MPF's
visual_pinball_engineplatform passes config numbers through as opaque strings.lightis reported as a lamp andgias a GI string, each with its config number.Values:
Threading: commands from the gRPC threads are timestamped and applied in order once per frame on the main thread, with no allocation per frame in steady state. Detaching drops anything still queued.
Not covered: MPF's VPE platform has no mechs or segment metadata.
Separate existing bug, not fixed here:
MpfExtensions.GetLampNumbersByNameDictkeys lamps byHardwareChannelColorinstead ofHardwareChannelNumber. Incoming fades therefore fail their lookup, and mapped MPF lamps don't light onmaster.Testing: verified with a standalone harness of 105 checks (not part of this repo, which has no test project). Not yet run in Unity or against live MPF.