Changelog
-
The plugin can now define addons to be mounted by all or specific clients, for example this can be used in servers (with custom plugin logic) that have content addons in different languages.
An important distinction is that such addons will not be mounted or downloaded by the server; they're strictly client-only addons.
To facilitate this new functionality, several new cvars and commands were added:
mm_client_extra_addons <ids> // The workshop IDs of extra client-side only addons that will be loaded by all clients, separated by commas. These addons are not loaded or downloaded by the server. Changes will only apply to future clients.
mm_cache_clients_duration <0/seconds> (default 0) How long to cache clients' downloaded addons list, pass 0 for forever.
mm_add_client_addon <id> Add a workshop ID to the global client-only addon list.
mm_remove_client_addon <id> Remove a workshop ID from the global client-only addon list.
Adding an addon to a specific client's addon list can only be done via the interface, which has the following new functions:
// Check whether the server is connected to the game coordinator, and therefore is capable of downloading addons.
// Should be called before calling DownloadAddon.
virtual bool HasUGCConnection() = 0;
// Functions to manage addons to be loaded only by a client.
// Pass a steamID value of 0 to perform the operation on a global list instead, and bRefresh to 'true' to trigger a reconnect if necessary.
virtual void AddClientAddon(const char *pszAddon, uint64 steamID64 = 0, bool bRefresh = false) = 0;
virtual void RemoveClientAddon(const char *pszAddon, uint64 steamID64 = 0) = 0;
virtual void ClearClientAddons(uint64 steamID64 = 0) = 0;