Skip to content

Switch manager not showing correct status for multi-matched switch devices #345

@jsm174

Description

@jsm174

This was discovered while working on #344.

We are seeing that the switch manager is not showing the correct status for multi-matched switch devices.

Using Rock as our example, switch 41 is currently used in 8 places:

  • A (Behind upper drop target bank)
  • B (Behind lower drop target bank)
  • C (Upper left side rubber)
  • D (Upper right side rubber)
  • E (Middle left side rubber)
  • F (Middle right side rubber)
  • G (Left slingshot - FUTURE)
  • H (Right slingshot - FUTURE)

If the user hits A, all 41 entries in the Switch Manager close. Totally fine.

Screen Shot 2021-11-23 at 6 51 53 PM

However, if the user hits B, C , D, E, F, G, H, the entries in the switch manager will not close.

The Game Logic Engine will work fine and PinMame registers the switch for A - H.

The SwitchPlayer statuses are a dictionary by ID 41

if (deviceSwitch != null) {
var switchStatus = deviceSwitch.AddSwitchDest(new SwitchConfig(switchMapping));
SwitchStatuses[switchMapping.Id] = switchStatus;

So when the player is populating the dictionary, each ID 41 switch device overwrites the last one.

So that's why the manager looks like its only monitoring one device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions