Interface IMyDLCs
Describes API, that allows you get information about DLCs (mods interface)
Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyDLCs
Methods
ContainsRequiredDLC(MyDefinitionBase, List<UInt64>)
Returns whether the collection contains the DLCs in this definition.
Declaration
bool ContainsRequiredDLC(MyDefinitionBase definition, List<ulong> dlcs)
Parameters
| Type | Name | Description |
|---|---|---|
| MyDefinitionBase | definition | The definition to check. |
| System.Collections.Generic.List<System.UInt64> | dlcs | The collection to compare against. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the definition has no DLCs specified, or all the DLCs specified in |
GetAvailableClientDLCIds()
Returns a list of the DLCs installed on the local client.
Declaration
ListReader<uint> GetAvailableClientDLCIds()
Returns
| Type | Description |
|---|---|
| ListReader<System.UInt32> | List of AppId. |
GetDLC(String)
Gets information on the requested DLC.
Declaration
IMyDLC GetDLC(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Name of the DLC |
Returns
| Type | Description |
|---|---|
| IMyDLC | Requested DLC information. |
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | Name supplied doesn't match a known DLC. |
GetDLC(UInt32)
Gets information on the requested DLC.
Declaration
IMyDLC GetDLC(uint appId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | appId | The AppId of the DLC |
Returns
| Type | Description |
|---|---|
| IMyDLC | Requested DLC information. |
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | AppId supplied doesn't match a known DLC. |
GetDLCs()
Get a list of all DLCs the game has. This will not change for the lifetime of the session and is safe to cache.
Declaration
ListReader<IMyDLC> GetDLCs()
Returns
| Type | Description |
|---|---|
| ListReader<IMyDLC> |
GetFirstMissingDefinitionDLC(MyDefinitionBase, UInt64)
Get the first DLC a player is missing that a definition requires. Null if they have all.
Declaration
IMyDLC GetFirstMissingDefinitionDLC(MyDefinitionBase definition, ulong steamId)
Parameters
| Type | Name | Description |
|---|---|---|
| MyDefinitionBase | definition | The definition to check. |
| System.UInt64 | steamId | The SteamID of the user to check against. |
Returns
| Type | Description |
|---|---|
| IMyDLC | The first DLC not available by the specified |
GetRequiredDLCTooltip(String)
Returns the tooltip text that is shown to the user if they don't own the DLC.
Declaration
string GetRequiredDLCTooltip(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Name of the DLC |
Returns
| Type | Description |
|---|---|
| System.String | Localized and formatted version of MyCommonTexts.RequiresDlc |
GetRequiredDLCTooltip(UInt32)
Returns the tooltip text that is shown to the user if they don't own the DLC.
Declaration
string GetRequiredDLCTooltip(uint appId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | appId | The AppId of the DLC |
Returns
| Type | Description |
|---|---|
| System.String | Localized and formatted version of MyCommonTexts.RequiresDlc |
HasDefinitionDLC(MyDefinitionBase, UInt64)
Returns whether a player owns all DLCs required by this definition.
Declaration
bool HasDefinitionDLC(MyDefinitionBase definition, ulong steamId)
Parameters
| Type | Name | Description |
|---|---|---|
| MyDefinitionBase | definition | The definition to check. |
| System.UInt64 | steamId | The SteamID of the user to check against. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the player owns all the DLC in the definition. |
HasDefinitionDLC(MyDefinitionId, UInt64)
Returns whether a player owns all DLCs required by this definition id.
Declaration
bool HasDefinitionDLC(MyDefinitionId definitionId, ulong steamId)
Parameters
| Type | Name | Description |
|---|---|---|
| MyDefinitionId | definitionId | The definition id to check. |
| System.UInt64 | steamId | The SteamID of the user to check against. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the player owns all the DLC in the definition. |
HasDLC(String, UInt64)
Return whether a player owns a DLC.
Declaration
bool HasDLC(string name, ulong steamId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Name of the DLC |
| System.UInt64 | steamId | The SteamID of the player to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the player owns that DLC. |
HasDLC(UInt32, UInt64)
Return whether a player owns a DLC.
Declaration
bool HasDLC(uint appId, ulong steamId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | appId | The AppId of the DLC |
| System.UInt64 | steamId | The SteamID of the player to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the player owns that DLC. |
IsDLCSupported(String)
Check if DLC is supported on this platform.
Declaration
bool IsDLCSupported(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Name of the DLC |
Returns
| Type | Description |
|---|---|
| System.Boolean |
TryGetDLC(String, out IMyDLC)
Gets information on the requested DLC.
Declaration
bool TryGetDLC(string name, out IMyDLC dlc)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Name of the DLC |
| IMyDLC | dlc | The requested DLC information. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if DLC exists and |
TryGetDLC(UInt32, out IMyDLC)
Gets information on the requested DLC.
Declaration
bool TryGetDLC(uint appId, out IMyDLC dlc)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | appId | The AppId of the DLC |
| IMyDLC | dlc | The requested DLC information. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if DLC exists and |
Events
DLCInstalled
Called when a new DLC is installed by a client. On the client, this only reports DLC installed on the local client.
Declaration
event Action<ulong, uint> DLCInstalled
Event Type
| Type | Description |
|---|---|
| System.Action<System.UInt64, System.UInt32> |
Remarks
The first action argument is the client SteamId. The second argument is the DLC AppId. This event will be called on the server each time a player connects.
Note:
Space Engineers 2013 is AppId 573900
Deluxe Edition Artwork is AppId 573161
Neither of the above DLC are present in the list returned by GetDLCs(). In addition, GetDLC(UInt32) will throw System.Collections.Generic.KeyNotFoundException when passed either of those AppIds.