Skip to content
Permalink
Browse files

Updated to Steamworks SDK 1.42

  • Loading branch information...
rlabrecque committed Jan 7, 2018
1 parent 625e1cc commit c3e495de80be75d46443175273acc74e737bb0f6
@@ -11,10 +11,10 @@
namespace Steamworks {
public static class Version {
public const string SteamworksNETVersion = "11.0.0";
public const string SteamworksSDKVersion = "1.41";
public const string SteamAPIDLLVersion = "01.00.00.01";
public const int SteamAPIDLLSize = 225056;
public const int SteamAPI64DLLSize = 249120;
public const string SteamworksSDKVersion = "1.42";
public const string SteamAPIDLLVersion = "04.28.51.07";
public const int SteamAPIDLLSize = 227616;
public const int SteamAPI64DLLSize = 250656;
}

public static class SteamAPI {
@@ -268,7 +268,6 @@ internal static class CSteamAPIContext {
m_pSteamHTTP = IntPtr.Zero;
m_pSteamScreenshots = IntPtr.Zero;
m_pSteamMusic = IntPtr.Zero;
m_pSteamUnifiedMessages = IntPtr.Zero;
m_pController = IntPtr.Zero;
m_pSteamUGC = IntPtr.Zero;
m_pSteamAppList = IntPtr.Zero;
@@ -324,9 +323,6 @@ internal static class CSteamAPIContext {
m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
if (m_pSteamHTTP == IntPtr.Zero) { return false; }

m_pSteamUnifiedMessages = SteamClient.GetISteamUnifiedMessages(hSteamUser, hSteamPipe, Constants.STEAMUNIFIEDMESSAGES_INTERFACE_VERSION);
if (m_pSteamUnifiedMessages == IntPtr.Zero) { return false; }

m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, Constants.STEAMCONTROLLER_INTERFACE_VERSION);
if (m_pController == IntPtr.Zero) { return false; }

@@ -369,7 +365,6 @@ internal static class CSteamAPIContext {
internal static IntPtr GetSteamRemoteStorage() { return m_pSteamRemoteStorage; }
internal static IntPtr GetSteamScreenshots() { return m_pSteamScreenshots; }
internal static IntPtr GetSteamHTTP() { return m_pSteamHTTP; }
internal static IntPtr GetSteamUnifiedMessages() { return m_pSteamUnifiedMessages; }
internal static IntPtr GetSteamController() { return m_pController; }
internal static IntPtr GetSteamUGC() { return m_pSteamUGC; }
internal static IntPtr GetSteamAppList() { return m_pSteamAppList; }
@@ -392,7 +387,6 @@ internal static class CSteamAPIContext {
private static IntPtr m_pSteamRemoteStorage;
private static IntPtr m_pSteamScreenshots;
private static IntPtr m_pSteamHTTP;
private static IntPtr m_pSteamUnifiedMessages;
private static IntPtr m_pController;
private static IntPtr m_pSteamUGC;
private static IntPtr m_pSteamAppList;
@@ -364,9 +364,6 @@ internal static class NativeMethods {
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTTP", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ISteamClient_GetISteamHTTP(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUnifiedMessages", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ISteamClient_GetISteamUnifiedMessages(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamController", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ISteamClient_GetISteamController(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion);

@@ -422,6 +419,18 @@ internal static class NativeMethods {
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_GetCurrentActionSet", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamController_GetCurrentActionSet(IntPtr instancePtr, ControllerHandle_t controllerHandle);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_ActivateActionSetLayer", CallingConvention = CallingConvention.Cdecl)]
public static extern void ISteamController_ActivateActionSetLayer(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_DeactivateActionSetLayer", CallingConvention = CallingConvention.Cdecl)]
public static extern void ISteamController_DeactivateActionSetLayer(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_DeactivateAllActionSetLayers", CallingConvention = CallingConvention.Cdecl)]
public static extern void ISteamController_DeactivateAllActionSetLayers(IntPtr instancePtr, ControllerHandle_t controllerHandle);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_GetActiveActionSetLayers", CallingConvention = CallingConvention.Cdecl)]
public static extern int ISteamController_GetActiveActionSetLayers(IntPtr instancePtr, ControllerHandle_t controllerHandle, out ControllerActionSetHandle_t handlesOut);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamController_GetDigitalActionHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionName);

@@ -477,6 +486,9 @@ internal static class NativeMethods {

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, EControllerActionOrigin eOrigin);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamController_GetInputTypeForHandle", CallingConvention = CallingConvention.Cdecl)]
public static extern ESteamInputType ISteamController_GetInputTypeForHandle(IntPtr instancePtr, ControllerHandle_t controllerHandle);
#endregion
#region SteamFriends
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName", CallingConvention = CallingConvention.Cdecl)]
@@ -703,6 +715,14 @@ internal static class NativeMethods {

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamFriends_EnumerateFollowingList", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamFriends_EnumerateFollowingList(IntPtr instancePtr, uint unStartIndex);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanPublic", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamFriends_IsClanPublic(IntPtr instancePtr, CSteamID steamIDClan);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamFriends_IsClanOfficialGameGroup(IntPtr instancePtr, CSteamID steamIDClan);
#endregion
#region SteamGameServer
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer", CallingConvention = CallingConvention.Cdecl)]
@@ -1189,6 +1209,50 @@ internal static class NativeMethods {
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_GetEligiblePromoItemDefinitionIDs(IntPtr instancePtr, CSteamID steamID, [In, Out] SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartPurchase", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamInventory_StartPurchase(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pArrayItemDefs, [In, Out] uint[] punArrayQuantity, uint unArrayLength);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_RequestPrices", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamInventory_RequestPrices(IntPtr instancePtr);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ISteamInventory_GetNumItemsWithPrices(IntPtr instancePtr);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pArrayItemDefs, [In, Out] ulong[] pPrices, uint unArrayLength);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_GetItemPrice(IntPtr instancePtr, SteamItemDef_t iDefinition, out ulong pPrice);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamInventory_StartUpdateProperties(IntPtr instancePtr);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_RemoveProperty(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_SetProperty(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, InteropHelp.UTF8StringHandle pchPropertyValue);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty0", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_SetProperty0(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, [MarshalAs(UnmanagedType.I1)] bool bValue);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty0", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_SetProperty0(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, long nValue);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty0", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_SetProperty0(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, float flValue);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_SubmitUpdateProperties", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_SubmitUpdateProperties(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle);
#endregion
#region SteamMatchmaking
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount", CallingConvention = CallingConvention.Cdecl)]
@@ -2154,26 +2218,6 @@ internal static class NativeMethods {
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUGC_DeleteItem", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamUGC_DeleteItem(IntPtr instancePtr, PublishedFileId_t nPublishedFileID);
#endregion
#region SteamUnifiedMessages
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUnifiedMessages_SendMethod", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ISteamUnifiedMessages_SendMethod(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchServiceMethod, byte[] pRequestBuffer, uint unRequestBufferSize, ulong unContext);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUnifiedMessages_GetMethodResponseInfo", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamUnifiedMessages_GetMethodResponseInfo(IntPtr instancePtr, ClientUnifiedMessageHandle hHandle, out uint punResponseSize, out EResult peResult);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUnifiedMessages_GetMethodResponseData", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamUnifiedMessages_GetMethodResponseData(IntPtr instancePtr, ClientUnifiedMessageHandle hHandle, byte[] pResponseBuffer, uint unResponseBufferSize, [MarshalAs(UnmanagedType.I1)] bool bAutoRelease);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUnifiedMessages_ReleaseMethod", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamUnifiedMessages_ReleaseMethod(IntPtr instancePtr, ClientUnifiedMessageHandle hHandle);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUnifiedMessages_SendNotification", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamUnifiedMessages_SendNotification(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchServiceNotification, byte[] pNotificationBuffer, uint unNotificationBufferSize);
#endregion
#region SteamUser
[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser", CallingConvention = CallingConvention.Cdecl)]
public static extern int ISteamUser_GetHSteamUser(IntPtr instancePtr);
@@ -781,6 +781,17 @@ public struct HTML_HideToolTip_t {
public HHTMLBrowser unBrowserHandle; // the handle of the surface
}

//-----------------------------------------------------------------------------
// Purpose: The browser has restarted due to an internal failure, use this new handle value
//-----------------------------------------------------------------------------
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
[CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 27)]
public struct HTML_BrowserRestarted_t {
public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 27;
public HHTMLBrowser unBrowserHandle; // this is the new browser handle after the restart
public HHTMLBrowser unOldBrowserHandle; // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls
}

// callbacks
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
[CallbackIdentity(Constants.k_iClientHTTPCallbacks + 1)]
@@ -886,6 +897,26 @@ public struct SteamInventoryEligiblePromoItemDefIDs_t {
public bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server
}

// Triggered from StartPurchase call
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
[CallbackIdentity(Constants.k_iClientInventoryCallbacks + 4)]
public struct SteamInventoryStartPurchaseResult_t {
public const int k_iCallback = Constants.k_iClientInventoryCallbacks + 4;
public EResult m_result;
public ulong m_ulOrderID;
public ulong m_ulTransID;
}

// Triggered from RequestPrices
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
[CallbackIdentity(Constants.k_iClientInventoryCallbacks + 5)]
public struct SteamInventoryRequestPricesResult_t {
public const int k_iCallback = Constants.k_iClientInventoryCallbacks + 5;
public EResult m_result;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string m_rgchCurrency;
}

//-----------------------------------------------------------------------------
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
//-----------------------------------------------------------------------------
@@ -1832,17 +1863,6 @@ public struct DeleteItemResult_t {
public PublishedFileId_t m_nPublishedFileId;
}

// callbacks
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
[CallbackIdentity(Constants.k_iClientUnifiedMessagesCallbacks + 1)]
public struct SteamUnifiedMessagesSendMethodResult_t {
public const int k_iCallback = Constants.k_iClientUnifiedMessagesCallbacks + 1;
public ClientUnifiedMessageHandle m_hHandle; // The handle returned by SendMethod().
public ulong m_unContext; // Context provided when calling SendMethod().
public EResult m_eResult; // The result of the method call.
public uint m_unResponseSize; // The size of the response.
}

// callbacks
//-----------------------------------------------------------------------------
// Purpose: called when a connections to the Steam back-end has been established
@@ -16,7 +16,7 @@ public static class Constants {
public const string STEAMAPPS_INTERFACE_VERSION = "STEAMAPPS_INTERFACE_VERSION008";
public const string STEAMAPPTICKET_INTERFACE_VERSION = "STEAMAPPTICKET_INTERFACE_VERSION001";
public const string STEAMCLIENT_INTERFACE_VERSION = "SteamClient017";
public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController005";
public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController006";
public const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends015";
public const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001";
public const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer012";
@@ -33,7 +33,6 @@ public static class Constants {
public const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014";
public const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003";
public const string STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION010";
public const string STEAMUNIFIEDMESSAGES_INTERFACE_VERSION = "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001";
public const string STEAMUSER_INTERFACE_VERSION = "SteamUser019";
public const string STEAMUSERSTATS_INTERFACE_VERSION = "STEAMUSERSTATS_INTERFACE_VERSION011";
public const string STEAMUTILS_INTERFACE_VERSION = "SteamUtils009";
@@ -93,6 +92,7 @@ public static class Constants {
public const int k_iClientBluetoothManagerCallbacks = 4800;
public const int k_iClientSharedConnectionCallbacks = 4900;
public const int k_ISteamParentalSettingsCallbacks = 5000;
public const int k_iClientShaderCallbacks = 5100;
// maximum length of friend group name (not including terminating nul!)
public const int k_cchMaxFriendsGroupName = 64;
// maximum number of groups a single user is allowed

0 comments on commit c3e495d

Please sign in to comment.
You can’t perform that action at this time.