openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
151 stars 81 forks source link

Stop producing federate from receiving DiscoverObjectCalls on its own object #322

Closed martinffi closed 2 years ago

martinffi commented 3 years ago

The RegisterObjectHandler sends a ManyCast message to all subscribed federates when a new object is created. The producing federate is removed from the list of subscribed federates, to prevent it from receiving a Discover message on its own objects. However, if no other federates subscribe to the object class, the list of subscribers is empty. The queueManycast method takes an empty list of recipients to mean that the message should be broadcast to everybody, meaning the producing federate will receive a DiscoverObject call on its own object. Fixed by adding a check to avoid sending the DiscoverObject message when the list of recipients is empty.

timpokorny commented 2 years ago

Thank-you! Sorry it took so long to get to these.