OpenPerpetuum / PerpetuumServer

The Open Perpetuum Project's fork of the Perpetuum Standalone Server
https://openperpetuum.com
Other
44 stars 21 forks source link

EventListener publish message optimizations #246

Closed MikeJeffers closed 3 years ago

MikeJeffers commented 3 years ago

This: https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/Services/EventServices/EventListenerService.cs#L16 Could be a collection keyed by the message types that they listen for. Then this: https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/Services/EventServices/EventListenerService.cs#L34-L40 could notify only relevant observers, and the notified observers will only get messages of the type they desire (remove type check, reduce 90% of irrelevant message load)