SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Add multiplayer sync events

Pathoschild opened this issue ยท 2 comments

commented

Add mod events for the multiplayer sync, for mods like PyTK which need to replace objects with sync-safe equivalents before sync.

commented

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?

commented

Done in develop for the upcoming SMAPI 2.6.