Skip to content

Commit ec61e04

Browse files
committed
Update Steamworks.NET to 370f8588a09cd5b755ee29051324a44b09466757
1 parent 868274c commit ec61e04

File tree

9 files changed

+119
-43
lines changed

9 files changed

+119
-43
lines changed

Assets/Editor/Steamworks.NET/RedistCopy.cs

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,41 @@ public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProj
2626
string pluginsDir;
2727
switch(target)
2828
{
29-
case BuildTarget.StandaloneWindows:
30-
case BuildTarget.StandaloneWindows64:
31-
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
32-
pluginsDir = Path.Combine(baseDir, "Plugins");
33-
break;
34-
case BuildTarget.StandaloneLinux:
35-
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
36-
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86");
37-
break;
38-
case BuildTarget.StandaloneLinux64:
39-
case BuildTarget.StandaloneLinuxUniversal:
40-
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
41-
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86_64");
42-
break;
29+
case BuildTarget.StandaloneWindows:
30+
case BuildTarget.StandaloneWindows64:
31+
{
32+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
33+
pluginsDir = Path.Combine(baseDir, "Plugins");
34+
break;
35+
}
36+
#if !UNITY_2019_2_OR_NEWER
37+
case BuildTarget.StandaloneLinux:
38+
{
39+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
40+
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86");
41+
break;
42+
}
43+
case BuildTarget.StandaloneLinuxUniversal:
44+
#endif
45+
case BuildTarget.StandaloneLinux64:
46+
{
47+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
48+
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86_64");
49+
break;
50+
}
4351
#if UNITY_2017_3_OR_NEWER
44-
case BuildTarget.StandaloneOSX:
52+
case BuildTarget.StandaloneOSX:
4553
#else
46-
case BuildTarget.StandaloneOSXIntel:
47-
case BuildTarget.StandaloneOSXIntel64:
48-
case BuildTarget.StandaloneOSXUniversal:
54+
case BuildTarget.StandaloneOSXIntel:
55+
case BuildTarget.StandaloneOSXIntel64:
56+
case BuildTarget.StandaloneOSXUniversal:
4957
#endif
50-
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + ".app");
51-
baseDir = Path.Combine(baseDir, "Contents");
52-
pluginsDir = Path.Combine(baseDir, "Plugins");
53-
break;
58+
{
59+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + ".app");
60+
baseDir = Path.Combine(baseDir, "Contents");
61+
pluginsDir = Path.Combine(baseDir, "Plugins");
62+
break;
63+
}
5464
default:
5565
return;
5666
}

Assets/Editor/Steamworks.NET/RedistInstall.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ static void SetPlatformSettings() {
9696
didUpdate |= ResetPluginSettings(plugin, "x86_64", "Linux");
9797
didUpdate |= SetCompatibleWithLinux(plugin, BuildTarget.StandaloneLinux64);
9898
}
99+
#if !UNITY_2019_2_OR_NEWER
99100
else {
100101
didUpdate |= ResetPluginSettings(plugin, "x86", "Linux");
101102
didUpdate |= SetCompatibleWithLinux(plugin, BuildTarget.StandaloneLinux);
102103
}
104+
#endif
103105
break;
104106
case "steam_api.dll":
105107
case "steam_api64.dll":
@@ -170,9 +172,11 @@ static bool SetCompatibleWithOSX(PluginImporter plugin) {
170172
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, true);
171173
#endif
172174

175+
#if !UNITY_2019_2_OR_NEWER
173176
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
174-
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
175177
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false);
178+
#endif
179+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
176180
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false);
177181
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false);
178182

@@ -182,6 +186,7 @@ static bool SetCompatibleWithOSX(PluginImporter plugin) {
182186
static bool SetCompatibleWithLinux(PluginImporter plugin, BuildTarget platform) {
183187
bool didUpdate = false;
184188

189+
#if !UNITY_2019_2_OR_NEWER
185190
if (platform == BuildTarget.StandaloneLinux) {
186191
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, true);
187192
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
@@ -191,6 +196,9 @@ static bool SetCompatibleWithLinux(PluginImporter plugin, BuildTarget platform)
191196
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, true);
192197
}
193198
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, true);
199+
#else
200+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, true);
201+
#endif
194202

195203
#if UNITY_2017_3_OR_NEWER
196204
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
@@ -217,9 +225,11 @@ static bool SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform
217225
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, true);
218226
}
219227

220-
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
228+
#if !UNITY_2019_2_OR_NEWER
221229
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
222230
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false);
231+
#endif
232+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
223233
#if UNITY_2017_3_OR_NEWER
224234
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
225235
#else
@@ -234,9 +244,11 @@ static bool SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform
234244
static bool SetCompatibleWithEditor(PluginImporter plugin) {
235245
bool didUpdate = false;
236246

237-
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
247+
#if !UNITY_2019_2_OR_NEWER
238248
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
239249
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false);
250+
#endif
251+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
240252
#if UNITY_2017_3_OR_NEWER
241253
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
242254
#else

Assets/Plugins/Steamworks.NET/autogen/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ internal static class NativeMethods {
13481348

13491349
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs", CallingConvention = CallingConvention.Cdecl)]
13501350
[return: MarshalAs(UnmanagedType.I1)]
1351-
public static extern bool ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize);
1351+
public static extern bool ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize);
13521352

13531353
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty", CallingConvention = CallingConvention.Cdecl)]
13541354
[return: MarshalAs(UnmanagedType.I1)]

Assets/Plugins/Steamworks.NET/autogen/SteamConstants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static class Constants {
2323
public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController007";
2424
public const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends017";
2525
public const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001";
26-
public const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001";
2726
public const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer012";
2827
public const string STEAMGAMESERVERSTATS_INTERFACE_VERSION = "SteamGameServerStats001";
2928
public const string STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_005";
@@ -32,11 +31,12 @@ public static class Constants {
3231
public const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V003";
3332
public const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009";
3433
public const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002";
34+
public const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001";
35+
public const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002";
3536
public const string STEAMMUSIC_INTERFACE_VERSION = "STEAMMUSIC_INTERFACE_VERSION001";
3637
public const string STEAMMUSICREMOTE_INTERFACE_VERSION = "STEAMMUSICREMOTE_INTERFACE_VERSION001";
3738
public const string STEAMNETWORKING_INTERFACE_VERSION = "SteamNetworking005";
3839
public const string STEAMPARENTALSETTINGS_INTERFACE_VERSION = "STEAMPARENTALSETTINGS_INTERFACE_VERSION001";
39-
public const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002";
4040
public const string STEAMREMOTEPLAY_INTERFACE_VERSION = "STEAMREMOTEPLAY_INTERFACE_VERSION001";
4141
public const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014";
4242
public const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003";

Assets/Plugins/Steamworks.NET/autogen/isteamcontroller.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public static void DeactivateAllActionSetLayers(ControllerHandle_t controllerHan
106106
/// </summary>
107107
public static int GetActiveActionSetLayers(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t[] handlesOut) {
108108
InteropHelp.TestIfAvailableClient();
109+
if (handlesOut.Length != Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS) {
110+
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS!");
111+
}
109112
return NativeMethods.ISteamController_GetActiveActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle, handlesOut);
110113
}
111114

@@ -137,6 +140,9 @@ public static ControllerDigitalActionData_t GetDigitalActionData(ControllerHandl
137140
/// </summary>
138141
public static int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin[] originsOut) {
139142
InteropHelp.TestIfAvailableClient();
143+
if (originsOut.Length != Constants.STEAM_CONTROLLER_MAX_ORIGINS) {
144+
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
145+
}
140146
return NativeMethods.ISteamController_GetDigitalActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, digitalActionHandle, originsOut);
141147
}
142148

@@ -165,6 +171,9 @@ public static ControllerAnalogActionData_t GetAnalogActionData(ControllerHandle_
165171
/// </summary>
166172
public static int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin[] originsOut) {
167173
InteropHelp.TestIfAvailableClient();
174+
if (originsOut.Length != Constants.STEAM_CONTROLLER_MAX_ORIGINS) {
175+
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
176+
}
168177
return NativeMethods.ISteamController_GetAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, analogActionHandle, originsOut);
169178
}
170179

Assets/Plugins/Steamworks.NET/autogen/isteamgameserverinventory.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) {
4141
/// </summary>
4242
public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) {
4343
InteropHelp.TestIfAvailableGameServer();
44+
if (pOutItemsArray.Length != punOutItemsArraySize) {
45+
throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!");
46+
}
4447
return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize);
4548
}
4649

@@ -298,9 +301,12 @@ public static bool LoadItemDefinitions() {
298301
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
299302
/// <para> return false if and only if there is not enough space in the output array.</para>
300303
/// </summary>
301-
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize) {
304+
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
302305
InteropHelp.TestIfAvailableGameServer();
303-
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, out punItemDefIDsArraySize);
306+
if (pItemDefIDs.Length != punItemDefIDsArraySize) {
307+
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
308+
}
309+
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
304310
}
305311

306312
/// <summary>
@@ -342,6 +348,9 @@ public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID ste
342348
/// </summary>
343349
public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
344350
InteropHelp.TestIfAvailableGameServer();
351+
if (pItemDefIDs.Length != punItemDefIDsArraySize) {
352+
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
353+
}
345354
return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize);
346355
}
347356

@@ -378,6 +387,15 @@ public static uint GetNumItemsWithPrices() {
378387
/// </summary>
379388
public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) {
380389
InteropHelp.TestIfAvailableGameServer();
390+
if (pArrayItemDefs.Length != unArrayLength) {
391+
throw new System.ArgumentException("pArrayItemDefs must be the same size as unArrayLength!");
392+
}
393+
if (pCurrentPrices.Length != unArrayLength) {
394+
throw new System.ArgumentException("pCurrentPrices must be the same size as unArrayLength!");
395+
}
396+
if (pBasePrices.Length != unArrayLength) {
397+
throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!");
398+
}
381399
return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength);
382400
}
383401

Assets/Plugins/Steamworks.NET/autogen/isteaminput.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public static void DeactivateAllActionSetLayers(InputHandle_t inputHandle) {
107107
/// </summary>
108108
public static int GetActiveActionSetLayers(InputHandle_t inputHandle, InputActionSetHandle_t[] handlesOut) {
109109
InteropHelp.TestIfAvailableClient();
110+
if (handlesOut.Length != Constants.STEAM_INPUT_MAX_ACTIVE_LAYERS) {
111+
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_INPUT_MAX_ACTIVE_LAYERS!");
112+
}
110113
return NativeMethods.ISteamInput_GetActiveActionSetLayers(CSteamAPIContext.GetSteamInput(), inputHandle, handlesOut);
111114
}
112115

@@ -138,6 +141,9 @@ public static InputDigitalActionData_t GetDigitalActionData(InputHandle_t inputH
138141
/// </summary>
139142
public static int GetDigitalActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin[] originsOut) {
140143
InteropHelp.TestIfAvailableClient();
144+
if (originsOut.Length != Constants.STEAM_INPUT_MAX_ORIGINS) {
145+
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!");
146+
}
141147
return NativeMethods.ISteamInput_GetDigitalActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, digitalActionHandle, originsOut);
142148
}
143149

@@ -166,6 +172,9 @@ public static InputAnalogActionData_t GetAnalogActionData(InputHandle_t inputHan
166172
/// </summary>
167173
public static int GetAnalogActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin[] originsOut) {
168174
InteropHelp.TestIfAvailableClient();
175+
if (originsOut.Length != Constants.STEAM_INPUT_MAX_ORIGINS) {
176+
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!");
177+
}
169178
return NativeMethods.ISteamInput_GetAnalogActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, analogActionHandle, originsOut);
170179
}
171180

Assets/Plugins/Steamworks.NET/autogen/isteaminventory.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) {
4141
/// </summary>
4242
public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) {
4343
InteropHelp.TestIfAvailableClient();
44+
if (pOutItemsArray.Length != punOutItemsArraySize) {
45+
throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!");
46+
}
4447
return NativeMethods.ISteamInventory_GetResultItems(CSteamAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize);
4548
}
4649

@@ -298,9 +301,12 @@ public static bool LoadItemDefinitions() {
298301
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
299302
/// <para> return false if and only if there is not enough space in the output array.</para>
300303
/// </summary>
301-
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize) {
304+
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
302305
InteropHelp.TestIfAvailableClient();
303-
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, out punItemDefIDsArraySize);
306+
if (pItemDefIDs.Length != punItemDefIDsArraySize) {
307+
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
308+
}
309+
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
304310
}
305311

306312
/// <summary>
@@ -342,6 +348,9 @@ public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID ste
342348
/// </summary>
343349
public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
344350
InteropHelp.TestIfAvailableClient();
351+
if (pItemDefIDs.Length != punItemDefIDsArraySize) {
352+
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
353+
}
345354
return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize);
346355
}
347356

@@ -378,6 +387,15 @@ public static uint GetNumItemsWithPrices() {
378387
/// </summary>
379388
public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) {
380389
InteropHelp.TestIfAvailableClient();
390+
if (pArrayItemDefs.Length != unArrayLength) {
391+
throw new System.ArgumentException("pArrayItemDefs must be the same size as unArrayLength!");
392+
}
393+
if (pCurrentPrices.Length != unArrayLength) {
394+
throw new System.ArgumentException("pCurrentPrices must be the same size as unArrayLength!");
395+
}
396+
if (pBasePrices.Length != unArrayLength) {
397+
throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!");
398+
}
381399
return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength);
382400
}
383401

0 commit comments

Comments
 (0)