mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
2d1facf59d
Adds xLib.pubsub for server-driven topic multicast: a producer resource subscribes players to a topic server-side and publishes data that is pushed only to the subscribed players. Clients listen with xLib.pubsub.on and never subscribe or publish themselves. The subscription registry is a single shared instance in the esx_lib server VM, reached cross-resource through exports; the client side is a per-VM listener over one net event. Subscriptions are cleaned up on playerDropped, so a reused serverId never inherits them, and on the owning resource stopping. Also adds xLib.triggerClientEvent, which packs the payload once when sending to many players; publish uses it so a broadcast to N subscribers serialises once.