Add multiplayer sync events
Pathoschild opened this issue ยท 2 comments
Add mod events for the multiplayer sync, for mods like PyTK which need to replace objects with sync-safe equivalents before sync.
The game mainly receives updates in Game1.multiplayer.UpdateEarly()
and broadcasts updates in Game1.multiplayer.UpdateLate()
. SMAPI can override Game1.multiplayer
with its own implementation to intercept those. There's a few other places that broadcasts updates, but looks like the most important stuff is in those two methods.
Something like MultiplayerEvents.BeforeOutgoingMainSync
, MultiplayerEvents.BeforeIncomingMainSync
, etc would work. Maybe more granular events like MultiplayerEvents.BeforeBroadcastLocationDelta
, MultiplayerEvents.BeforeBroadcastWorldState
, etc?