Push multiple updates in each update event

Refactor HostUpdatesEvent, InstanceDetailsUpdatesEvent, ModUpdatesEvent,
ModPackUpdatesEvent and UserUpdatesEvent to have multiple updates of the
entities they support in each event. This is intended to make the events
capable of syncing the entire list that they represent.
This commit is contained in:
Hornwitser committed 2023-12-08 22:01:46 +01:00
1 parent f12a9926eb
commit 20330bc2c3
18 files changed
+215 -190

No files matched your search

+11 -11
View File
@@ -229,29 +229,29 @@ export default class BaseControllerPlugin {
async onPrepareHostDisconnect(connection: HostConnection) { }
/**
* Called when a mod pack is updated
* Called when one or more mod packs are updated
*
* Invoked when a mod pack has been added, updated or deleted in the
* cluster.
* Invoked when one or more mod pack have been added, updated or deleted
* in the cluster.
*
* If the mod pack has been deleted its `.isDeleted` property will be
* If a mod pack has been deleted its `.isDeleted` property will be
* true.
*
* @param modPack - Mod pack that updated.
* @param modPacks - Mod packs that updated.
*/
async onModPackUpdated(modPack: ModPack) { }
async onModPacksUpdated(modPacks: ModPack[]) { }
/**
* Called when a mod stored on the controller is updated
* Called when one or more mod stored on the controller are updated
*
* Invoked when a mod has been added, updated or deleted from the pool
* of shared mods stored on the cluster.
* Invoked when one or more mods have been added, updated or deleted
* from the pool of shared mods stored on the cluster.
*
* If a mod has been deleted its `.isDeleted` property will be true.
*
* @param mod - Mod that updated.
* @param mods - Mods that updated.
*/
async onModUpdated(mod: ModInfo) { }
async onModsUpdated(mods: ModInfo[]) { }
/**
* Called when a player joins or leaves an instance