updated to steam sdk v1.57

updated generated code

added new parameter to GetAuthSessionTicket (required to prevent man-in-the-middle-attack)
implemented new GetTicketForWebApi + unit test
This commit is contained in:
MadDave666 2023-05-23 19:59:09 +02:00
parent ed68eefe99
commit 0760a22117
41 changed files with 665 additions and 246 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data;
namespace Steamworks
{
@ -46,7 +47,7 @@ public async Task BeginAuthSession()
//
// Clientside calls this function, gets ticket
//
var clientTicket = SteamUser.GetAuthSessionTicket();
var clientTicket = SteamUser.GetAuthSessionTicket( NetIdentity.LocalHost );
//
// The client sends this data to the server along with their steamid

View File

@ -6,6 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data;
namespace Steamworks
{
@ -61,7 +62,7 @@ public void SteamID()
[TestMethod]
public void AuthSession()
{
var ticket = SteamUser.GetAuthSessionTicket();
var ticket = SteamUser.GetAuthSessionTicket( NetIdentity.LocalHost );
Assert.AreNotEqual( 0, ticket.Handle );
Assert.AreNotEqual( 0, ticket.Data.Length );
@ -78,7 +79,7 @@ public void AuthSession()
[TestMethod]
public async Task AuthSessionAsync()
{
var ticket = await SteamUser.GetAuthSessionTicketAsync( 5.0 );
var ticket = await SteamUser.GetAuthSessionTicketAsync( NetIdentity.LocalHost, 5.0 );
Assert.AreNotEqual( 0, ticket.Handle );
Assert.AreNotEqual( 0, ticket.Data.Length );
@ -86,6 +87,17 @@ public async Task AuthSessionAsync()
Console.WriteLine( $"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }" );
}
[TestMethod]
public async Task TicketForWebApi()
{
var ticket = await SteamUser.GetTicketForWebApi( "some random string" );
Assert.AreNotEqual( 0, ticket.Handle );
Assert.AreNotEqual( 0, ticket.Data.Length );
Console.WriteLine( $"ticket.Handle: {ticket.Handle}" );
Console.WriteLine( $"ticket.Data: {string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) )}" );
}
[TestMethod]
public void SteamLevel()
{

View File

@ -23,6 +23,7 @@ public enum CallbackType
StoreAuthURLResponse = 165,
MarketEligibilityResponse = 166,
DurationControl = 167,
GetTicketForWebApiResponse = 168,
GSClientApprove = 201,
GSClientDeny = 202,
GSClientKick = 203,
@ -74,8 +75,8 @@ public enum CallbackType
GamepadTextInputDismissed = 714,
AppResumingFromSuspend = 736,
FloatingGamepadTextInputDismissed = 738,
FilterTextDictionaryChanged = 739,
DlcInstalled = 1005,
RegisterActivationCodeResponse = 1008,
NewUrlLaunchParameters = 1014,
AppProofOfPurchaseKeyResponse = 1021,
FileDetailsResult = 1023,
@ -138,6 +139,7 @@ public enum CallbackType
SteamInputDeviceConnected = 2801,
SteamInputDeviceDisconnected = 2802,
SteamInputConfigurationLoaded = 2803,
SteamInputGamepadSlotChange = 2804,
SteamUGCQueryCompleted = 3401,
SteamUGCRequestUGCDetailsResult = 3402,
CreateItemResult = 3403,
@ -222,6 +224,7 @@ public enum CallbackType
ActiveBeaconsUpdated = 5306,
SteamRemotePlaySessionConnected = 5701,
SteamRemotePlaySessionDisconnected = 5702,
SteamRemotePlayTogetherGuestInvite = 5703,
}
internal static partial class CallbackTypeFactory
{
@ -242,6 +245,7 @@ internal static partial class CallbackTypeFactory
{ CallbackType.StoreAuthURLResponse, typeof( StoreAuthURLResponse_t )},
{ CallbackType.MarketEligibilityResponse, typeof( MarketEligibilityResponse_t )},
{ CallbackType.DurationControl, typeof( DurationControl_t )},
{ CallbackType.GetTicketForWebApiResponse, typeof( GetTicketForWebApiResponse_t )},
{ CallbackType.GSClientApprove, typeof( GSClientApprove_t )},
{ CallbackType.GSClientDeny, typeof( GSClientDeny_t )},
{ CallbackType.GSClientKick, typeof( GSClientKick_t )},
@ -293,8 +297,8 @@ internal static partial class CallbackTypeFactory
{ CallbackType.GamepadTextInputDismissed, typeof( GamepadTextInputDismissed_t )},
{ CallbackType.AppResumingFromSuspend, typeof( AppResumingFromSuspend_t )},
{ CallbackType.FloatingGamepadTextInputDismissed, typeof( FloatingGamepadTextInputDismissed_t )},
{ CallbackType.FilterTextDictionaryChanged, typeof( FilterTextDictionaryChanged_t )},
{ CallbackType.DlcInstalled, typeof( DlcInstalled_t )},
{ CallbackType.RegisterActivationCodeResponse, typeof( RegisterActivationCodeResponse_t )},
{ CallbackType.NewUrlLaunchParameters, typeof( NewUrlLaunchParameters_t )},
{ CallbackType.AppProofOfPurchaseKeyResponse, typeof( AppProofOfPurchaseKeyResponse_t )},
{ CallbackType.FileDetailsResult, typeof( FileDetailsResult_t )},
@ -355,6 +359,7 @@ internal static partial class CallbackTypeFactory
{ CallbackType.SteamInputDeviceConnected, typeof( SteamInputDeviceConnected_t )},
{ CallbackType.SteamInputDeviceDisconnected, typeof( SteamInputDeviceDisconnected_t )},
{ CallbackType.SteamInputConfigurationLoaded, typeof( SteamInputConfigurationLoaded_t )},
{ CallbackType.SteamInputGamepadSlotChange, typeof( SteamInputGamepadSlotChange_t )},
{ CallbackType.SteamUGCQueryCompleted, typeof( SteamUGCQueryCompleted_t )},
{ CallbackType.SteamUGCRequestUGCDetailsResult, typeof( SteamUGCRequestUGCDetailsResult_t )},
{ CallbackType.CreateItemResult, typeof( CreateItemResult_t )},
@ -439,6 +444,7 @@ internal static partial class CallbackTypeFactory
{ CallbackType.ActiveBeaconsUpdated, typeof( ActiveBeaconsUpdated_t )},
{ CallbackType.SteamRemotePlaySessionConnected, typeof( SteamRemotePlaySessionConnected_t )},
{ CallbackType.SteamRemotePlaySessionDisconnected, typeof( SteamRemotePlaySessionDisconnected_t )},
{ CallbackType.SteamRemotePlayTogetherGuestInvite, typeof( SteamRemotePlayTogetherGuestInvite_t )},
};
}
}

View File

@ -15,9 +15,9 @@ internal ISteamGameServer( bool IsGameServer )
SetupInterface( IsGameServer );
}
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServer_v014", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamGameServer_v014();
public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServer_v014();
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServer_v015", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamGameServer_v015();
public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServer_v015();
#region FunctionMeta
@ -269,12 +269,12 @@ internal void SetAdvertiseServerActive( [MarshalAs( UnmanagedType.U1 )] bool bAc
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetAuthSessionTicket", CallingConvention = Platform.CC)]
private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket );
private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket, ref NetIdentity pSnid );
#endregion
internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket )
internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket, ref NetIdentity pSnid )
{
var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket );
var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket, ref pSnid );
return returnValue;
}

View File

@ -15,12 +15,12 @@ internal ISteamUGC( bool IsGameServer )
SetupInterface( IsGameServer );
}
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUGC_v016", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamUGC_v016();
public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUGC_v016();
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUGC_v016", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamGameServerUGC_v016();
public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUGC_v016();
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUGC_v017", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamUGC_v017();
public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUGC_v017();
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUGC_v017", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamGameServerUGC_v017();
public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUGC_v017();
#region FunctionMeta
@ -249,6 +249,17 @@ internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, [Mars
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors", CallingConvention = Platform.CC)]
private static extern uint _GetQueryUGCContentDescriptors( IntPtr self, UGCQueryHandle_t handle, uint index, [In,Out] UGCContentDescriptorID[] pvecDescriptors, uint cMaxEntries );
#endregion
internal uint GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint index, [In,Out] UGCContentDescriptorID[] pvecDescriptors, uint cMaxEntries )
{
var returnValue = _GetQueryUGCContentDescriptors( Self, handle, index, pvecDescriptors, cMaxEntries );
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest", CallingConvention = Platform.CC)]
[return: MarshalAs( UnmanagedType.I1 )]
@ -727,6 +738,30 @@ internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index )
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddContentDescriptor", CallingConvention = Platform.CC)]
[return: MarshalAs( UnmanagedType.I1 )]
private static extern bool _AddContentDescriptor( IntPtr self, UGCUpdateHandle_t handle, UGCContentDescriptorID descid );
#endregion
internal bool AddContentDescriptor( UGCUpdateHandle_t handle, UGCContentDescriptorID descid )
{
var returnValue = _AddContentDescriptor( Self, handle, descid );
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveContentDescriptor", CallingConvention = Platform.CC)]
[return: MarshalAs( UnmanagedType.I1 )]
private static extern bool _RemoveContentDescriptor( IntPtr self, UGCUpdateHandle_t handle, UGCContentDescriptorID descid );
#endregion
internal bool RemoveContentDescriptor( UGCUpdateHandle_t handle, UGCContentDescriptorID descid )
{
var returnValue = _RemoveContentDescriptor( Self, handle, descid );
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate", CallingConvention = Platform.CC)]
private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote );

View File

@ -15,9 +15,9 @@ internal ISteamUser( bool IsGameServer )
SetupInterface( IsGameServer );
}
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUser_v021", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamUser_v021();
public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUser_v021();
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUser_v023", CallingConvention = Platform.CC)]
internal static extern IntPtr SteamAPI_SteamUser_v023();
public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUser_v023();
#region FunctionMeta
@ -165,12 +165,23 @@ internal uint GetVoiceOptimalSampleRate()
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAuthSessionTicket", CallingConvention = Platform.CC)]
private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket );
private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket, ref NetIdentity pSteamNetworkingIdentity );
#endregion
internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket )
internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket, ref NetIdentity pSteamNetworkingIdentity )
{
var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket );
var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket, ref pSteamNetworkingIdentity );
return returnValue;
}
#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAuthTicketForWebApi", CallingConvention = Platform.CC)]
private static extern HAuthTicket _GetAuthTicketForWebApi( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIdentity );
#endregion
internal HAuthTicket GetAuthTicketForWebApi( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIdentity )
{
var returnValue = _GetAuthTicketForWebApi( Self, pchIdentity );
return returnValue;
}

View File

@ -206,6 +206,22 @@ internal struct DurationControl_t : ICallbackData
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct GetTicketForWebApiResponse_t : ICallbackData
{
internal uint AuthTicket; // m_hAuthTicket HAuthTicket
internal Result Result; // m_eResult EResult
internal int Ticket; // m_cubTicket int
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2560)] // m_rgubTicket
internal byte[] GubTicket; // m_rgubTicket uint8 [2560]
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetTicketForWebApiResponse_t) );
public int DataSize => _datasize;
public CallbackType CallbackType => CallbackType.GetTicketForWebApiResponse;
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct PersonaStateChange_t : ICallbackData
{
@ -223,6 +239,9 @@ internal struct PersonaStateChange_t : ICallbackData
internal struct GameOverlayActivated_t : ICallbackData
{
internal byte Active; // m_bActive uint8
[MarshalAs(UnmanagedType.I1)]
internal bool UserInitiated; // m_bUserInitiated bool
internal AppId AppID; // m_nAppID AppId_t
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) );
@ -588,6 +607,7 @@ internal struct GamepadTextInputDismissed_t : ICallbackData
[MarshalAs(UnmanagedType.I1)]
internal bool Submitted; // m_bSubmitted bool
internal uint SubmittedText; // m_unSubmittedText uint32
internal AppId AppID; // m_unAppID AppId_t
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) );
@ -618,6 +638,18 @@ internal struct FloatingGamepadTextInputDismissed_t : ICallbackData
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct FilterTextDictionaryChanged_t : ICallbackData
{
internal int Language; // m_eLanguage int
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FilterTextDictionaryChanged_t) );
public int DataSize => _datasize;
public CallbackType CallbackType => CallbackType.FilterTextDictionaryChanged;
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct FavoritesListChanged_t : ICallbackData
{
@ -1570,19 +1602,6 @@ internal struct DlcInstalled_t : ICallbackData
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct RegisterActivationCodeResponse_t : ICallbackData
{
internal RegisterActivationCodeResult Result; // m_eResult ERegisterActivationCodeResult
internal uint PackageRegistered; // m_unPackageRegistered uint32
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) );
public int DataSize => _datasize;
public CallbackType CallbackType => CallbackType.RegisterActivationCodeResponse;
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct NewUrlLaunchParameters_t : ICallbackData
{
@ -1966,6 +1985,22 @@ internal struct SteamInputConfigurationLoaded_t : ICallbackData
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct SteamInputGamepadSlotChange_t : ICallbackData
{
internal AppId AppID; // m_unAppID AppId_t
internal ulong DeviceHandle; // m_ulDeviceHandle InputHandle_t
internal InputType DeviceType; // m_eDeviceType ESteamInputType
internal int OldGamepadSlot; // m_nOldGamepadSlot int
internal int NewGamepadSlot; // m_nNewGamepadSlot int
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInputGamepadSlotChange_t) );
public int DataSize => _datasize;
public CallbackType CallbackType => CallbackType.SteamInputGamepadSlotChange;
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct SteamUGCQueryCompleted_t : ICallbackData
{
@ -2761,6 +2796,20 @@ internal struct SteamRemotePlaySessionDisconnected_t : ICallbackData
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct SteamRemotePlayTogetherGuestInvite_t : ICallbackData
{
internal string ConnectURLUTF8() => System.Text.Encoding.UTF8.GetString( ConnectURL, 0, System.Array.IndexOf<byte>( ConnectURL, 0 ) );
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] // byte[] m_szConnectURL
internal byte[] ConnectURL; // m_szConnectURL char [1024]
#region SteamCallback
public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamRemotePlayTogetherGuestInvite_t) );
public int DataSize => _datasize;
public CallbackType CallbackType => CallbackType.SteamRemotePlayTogetherGuestInvite;
#endregion
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct SteamNetworkingMessagesSessionRequest_t : ICallbackData
{

View File

@ -230,6 +230,7 @@ public enum AuthResponse : int
AuthTicketInvalidAlreadyUsed = 7,
AuthTicketInvalid = 8,
PublisherIssuedBan = 9,
AuthTicketNetworkIdentityFailure = 10,
}
//
@ -315,6 +316,7 @@ internal enum ChatSteamIDInstanceFlags : int
//
public enum NotificationPosition : int
{
Invalid = -1,
TopLeft = 0,
TopRight = 1,
BottomLeft = 2,
@ -897,18 +899,6 @@ internal enum LeaderboardUploadScoreMethod : int
ForceUpdate = 2,
}
//
// ERegisterActivationCodeResult
//
internal enum RegisterActivationCodeResult : int
{
ResultOK = 0,
ResultFail = 1,
ResultAlreadyRegistered = 2,
ResultTimeout = 3,
AlreadyOwned = 4,
}
//
// EP2PSessionError
//
@ -1000,6 +990,7 @@ internal enum HTTPStatusCode : int
Code304NotModified = 304,
Code305UseProxy = 305,
Code307TemporaryRedirect = 307,
Code308PermanentRedirect = 308,
Code400BadRequest = 400,
Code401Unauthorized = 401,
Code402PaymentRequired = 402,
@ -1307,10 +1298,10 @@ internal enum InputActionOrigin : int
Switch_LeftGrip_Upper = 245,
Switch_RightGrip_Lower = 246,
Switch_RightGrip_Upper = 247,
Switch_Reserved11 = 248,
Switch_Reserved12 = 249,
Switch_Reserved13 = 250,
Switch_Reserved14 = 251,
Switch_JoyConButton_N = 248,
Switch_JoyConButton_E = 249,
Switch_JoyConButton_S = 250,
Switch_JoyConButton_W = 251,
Switch_Reserved15 = 252,
Switch_Reserved16 = 253,
Switch_Reserved17 = 254,
@ -1372,10 +1363,10 @@ internal enum InputActionOrigin : int
PS5_Gyro_Yaw = 310,
PS5_Gyro_Roll = 311,
PS5_DPad_Move = 312,
PS5_Reserved1 = 313,
PS5_Reserved2 = 314,
PS5_Reserved3 = 315,
PS5_Reserved4 = 316,
PS5_LeftGrip = 313,
PS5_RightGrip = 314,
PS5_LeftFn = 315,
PS5_RightFn = 316,
PS5_Reserved5 = 317,
PS5_Reserved6 = 318,
PS5_Reserved7 = 319,
@ -1994,7 +1985,15 @@ internal enum ControllerActionOrigin : int
SteamDeck_Reserved18 = 375,
SteamDeck_Reserved19 = 376,
SteamDeck_Reserved20 = 377,
Count = 378,
Switch_JoyConButton_N = 378,
Switch_JoyConButton_E = 379,
Switch_JoyConButton_S = 380,
Switch_JoyConButton_W = 381,
PS5_LeftGrip = 382,
PS5_RightGrip = 383,
PS5_LeftFn = 384,
PS5_RightFn = 385,
Count = 386,
MaximumPossibleValue = 32767,
}
@ -2145,6 +2144,18 @@ public enum ItemPreviewType : int
ReservedMax = 255,
}
//
// EUGCContentDescriptorID
//
internal enum UGCContentDescriptorID : int
{
NudityOrSexualContent = 1,
FrequentViolenceOrGore = 2,
AdultOnlySexualContent = 3,
GratuitousSexualContent = 4,
AnyMatureContent = 5,
}
//
// ESteamItemFlags
//
@ -2174,7 +2185,8 @@ public enum ParentalFeature : int
Library = 11,
Test = 12,
SiteLicense = 13,
Max = 14,
KioskMode = 14,
Max = 15,
}
//

View File

@ -105,6 +105,30 @@ internal struct P2PSessionState_t
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct InputMotionDataV2_t
{
internal float DriftCorrectedQuatX; // driftCorrectedQuatX float
internal float DriftCorrectedQuatY; // driftCorrectedQuatY float
internal float DriftCorrectedQuatZ; // driftCorrectedQuatZ float
internal float DriftCorrectedQuatW; // driftCorrectedQuatW float
internal float SensorFusionQuatX; // sensorFusionQuatX float
internal float SensorFusionQuatY; // sensorFusionQuatY float
internal float SensorFusionQuatZ; // sensorFusionQuatZ float
internal float SensorFusionQuatW; // sensorFusionQuatW float
internal float DeferredSensorFusionQuatX; // deferredSensorFusionQuatX float
internal float DeferredSensorFusionQuatY; // deferredSensorFusionQuatY float
internal float DeferredSensorFusionQuatZ; // deferredSensorFusionQuatZ float
internal float DeferredSensorFusionQuatW; // deferredSensorFusionQuatW float
internal float GravityX; // gravityX float
internal float GravityY; // gravityY float
internal float GravityZ; // gravityZ float
internal float DegreesPerSecondX; // degreesPerSecondX float
internal float DegreesPerSecondY; // degreesPerSecondY float
internal float DegreesPerSecondZ; // degreesPerSecondZ float
}
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )]
internal struct SteamInputActionEvent_t
{

View File

@ -43,6 +43,7 @@ internal static void InstallEvents()
Dispatch.Install<MicroTxnAuthorizationResponse_t>( x => OnMicroTxnAuthorizationResponse?.Invoke( x.AppID, x.OrderID, x.Authorized != 0 ) );
Dispatch.Install<GameWebCallback_t>( x => OnGameWebCallback?.Invoke( x.URLUTF8() ) );
Dispatch.Install<GetAuthSessionTicketResponse_t>( x => OnGetAuthSessionTicketResponse?.Invoke( x ) );
Dispatch.Install<GetTicketForWebApiResponse_t>( x => OnGetTicketForWebApiResponse?.Invoke( x ) );
Dispatch.Install<DurationControl_t>( x => OnDurationControl?.Invoke( new DurationControl { _inner = x } ) );
}
@ -93,6 +94,11 @@ internal static void InstallEvents()
/// </summary>
internal static event Action<GetAuthSessionTicketResponse_t> OnGetAuthSessionTicketResponse;
/// <summary>
/// Used internally for <see cref="GetTicketForWebApi"/>.
/// </summary>
internal static event Action<GetTicketForWebApiResponse_t> OnGetTicketForWebApiResponse;
/// <summary>
/// Invoked when a user has responded to a microtransaction authorization request.
/// ( appid, orderid, user authorized )
@ -303,17 +309,80 @@ public static unsafe int DecompressVoice( IntPtr from, int length, IntPtr to, in
return (int)szWritten;
}
/// <summary>
/// Retrieve an authentication ticket to be sent to the entity that wishes to authenticate you using the
/// ISteamUserAuth/AuthenticateUserTicket Web API.
/// It is best practice to use an identity string for each service that will consume tickets.
/// NOTE: This API can not be used to create a ticket for use by the BeginAuthSession/ISteamGameServer::BeginAuthSession.
/// Use the GetAuthSessionTicket API instead
/// </summary>
public static async Task<AuthTicket> GetTicketForWebApi(string identity, double timeoutSeconds = 10.0f )
{
var result = Result.Pending;
AuthTicket ticket = new AuthTicket();
var stopwatch = Stopwatch.StartNew();
void f( GetTicketForWebApiResponse_t t )
{
if ( t.AuthTicket == ticket.Handle)
{
ticket.Data = new byte[t.GubTicket.Length];
Array.Copy( t.GubTicket, ticket.Data, t.GubTicket.Length );
result = t.Result;
}
}
OnGetTicketForWebApiResponse += f;
try
{
ticket.Handle = Internal.GetAuthTicketForWebApi( identity );
if ( ticket.Handle == Defines.k_HAuthTicketInvalid)
return null;
while ( result == Result.Pending )
{
await Task.Delay( 10 );
if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds )
{
ticket.Cancel();
return null;
}
}
if ( result == Result.OK )
return ticket;
ticket.Cancel();
return null;
}
finally
{
OnGetTicketForWebApiResponse -= f;
}
}
/// <summary>
/// Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.
/// </summary>
public static unsafe AuthTicket GetAuthSessionTicket()
/// <param name="remoteSystemToAuthenticateTicket">
/// The identity of the remote system that will authenticate the ticket.
/// If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained
/// from a trusted 3rd party, otherwise use the IP address. If it is a service, a string identifier of that service if one if provided.
/// Example uses:
/// GetAuthSessionTicket(NetAddress.From("10.23.0.1", 5055))
/// GetAuthSessionTicket(new SteamId() { Value = 1234 })
/// </param>
public static unsafe AuthTicket GetAuthSessionTicket( NetIdentity remoteSystemToAuthenticateTicket )
{
var data = Helpers.TakeBuffer( 1024 );
fixed ( byte* b = data )
{
uint ticketLength = 0;
uint ticket = Internal.GetAuthSessionTicket( (IntPtr)b, data.Length, ref ticketLength );
uint ticket = Internal.GetAuthSessionTicket( (IntPtr)b, data.Length, ref ticketLength, ref remoteSystemToAuthenticateTicket );
if ( ticket == 0 )
return null;
@ -332,7 +401,15 @@ public static unsafe AuthTicket GetAuthSessionTicket()
/// the ticket is definitely ready to go as soon as it returns. Will return <see langword="null"/> if the callback
/// times out or returns negatively.
/// </summary>
public static async Task<AuthTicket> GetAuthSessionTicketAsync( double timeoutSeconds = 10.0f )
/// <param name="remoteSystemToAuthenticateTicket">
/// The identity of the remote system that will authenticate the ticket.
/// If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained
/// from a trusted 3rd party, otherwise use the IP address. If it is a service, a string identifier of that service if one if provided.
/// Example uses:
/// GetAuthSessionTicketAsync(NetAddress.From("10.23.0.1", 5055))
/// GetAuthSessionTicketAsync(new SteamId() { Value = 1234 })
/// </param>
public static async Task<AuthTicket> GetAuthSessionTicketAsync( NetIdentity remoteSystemToAuthenticateTicket, double timeoutSeconds = 10.0f )
{
var result = Result.Pending;
AuthTicket ticket = null;
@ -348,7 +425,7 @@ void f( GetAuthSessionTicketResponse_t t )
try
{
ticket = GetAuthSessionTicket();
ticket = GetAuthSessionTicket( remoteSystemToAuthenticateTicket );
if ( ticket == null )
return null;

Binary file not shown.

Binary file not shown.

View File

@ -47,7 +47,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIS
//---------------------------------------------------------------------------------
// Purpose: Sent when a new app is installed
// Purpose: Sent when a new app is installed (not downloaded yet)
//---------------------------------------------------------------------------------
STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 )
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs

View File

@ -137,30 +137,6 @@ struct DlcInstalled_t
};
//-----------------------------------------------------------------------------
// Purpose: possible results when registering an activation code
//-----------------------------------------------------------------------------
enum ERegisterActivationCodeResult
{
k_ERegisterActivationCodeResultOK = 0,
k_ERegisterActivationCodeResultFail = 1,
k_ERegisterActivationCodeResultAlreadyRegistered = 2,
k_ERegisterActivationCodeResultTimeout = 3,
k_ERegisterActivationCodeAlreadyOwned = 4,
};
//-----------------------------------------------------------------------------
// Purpose: response to RegisterActivationCode()
//-----------------------------------------------------------------------------
struct RegisterActivationCodeResponse_t
{
enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
ERegisterActivationCodeResult m_eResult;
uint32 m_unPackageRegistered; // package that was registered. Only set on success
};
//---------------------------------------------------------------------------------
// Purpose: posted after the user gains executes a Steam URL with command line or query parameters
// such as steam://run/<appid>//-commandline/?param1=value1&param2=value2&param3=value3 etc

View File

@ -21,9 +21,9 @@
#define STEAM_CONTROLLER_MAX_COUNT 16
#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 16
#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 24
#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 128
#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 256
#define STEAM_CONTROLLER_MAX_ORIGINS 8
@ -448,6 +448,16 @@ enum EControllerActionOrigin
k_EControllerActionOrigin_SteamDeck_Reserved19,
k_EControllerActionOrigin_SteamDeck_Reserved20,
k_EControllerActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical
k_EControllerActionOrigin_Switch_JoyConButton_E, // X
k_EControllerActionOrigin_Switch_JoyConButton_S, // A
k_EControllerActionOrigin_Switch_JoyConButton_W, // B
k_EControllerActionOrigin_PS5_LeftGrip,
k_EControllerActionOrigin_PS5_RightGrip,
k_EControllerActionOrigin_PS5_LeftFn,
k_EControllerActionOrigin_PS5_RightFn,
k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
};
@ -529,6 +539,7 @@ typedef uint64 ControllerAnalogActionHandle_t;
#define ControllerAnalogActionData_t InputAnalogActionData_t
#define ControllerDigitalActionData_t InputDigitalActionData_t
#define ControllerMotionData_t InputMotionData_t
#define ControllerMotionDataV2_t InputMotionDataV2_t
#else
struct ControllerAnalogActionData_t
{

View File

@ -514,7 +514,9 @@ enum EPersonaChange
struct GameOverlayActivated_t
{
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
uint8 m_bActive; // true if it's just been activated, false otherwise
uint8 m_bActive; // true if it's just been activated, false otherwise
bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated
AppId_t m_nAppID; // the appID of the game (should always be the current game)
};

View File

@ -152,7 +152,9 @@ public:
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
// pcbTicket retrieves the length of the actual ticket.
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
// SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid ) = 0;
// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
@ -264,7 +266,7 @@ public:
)
};
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer014"
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer015"
// Global accessor
inline ISteamGameServer *SteamGameServer();

View File

@ -17,9 +17,9 @@
#define STEAM_INPUT_MAX_COUNT 16
#define STEAM_INPUT_MAX_ANALOG_ACTIONS 16
#define STEAM_INPUT_MAX_ANALOG_ACTIONS 24
#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 128
#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 256
#define STEAM_INPUT_MAX_ORIGINS 8
@ -319,10 +319,10 @@ enum EInputActionOrigin
k_EInputActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button
k_EInputActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button
k_EInputActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button
k_EInputActionOrigin_Switch_Reserved11,
k_EInputActionOrigin_Switch_Reserved12,
k_EInputActionOrigin_Switch_Reserved13,
k_EInputActionOrigin_Switch_Reserved14,
k_EInputActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical
k_EInputActionOrigin_Switch_JoyConButton_E, // X
k_EInputActionOrigin_Switch_JoyConButton_S, // A
k_EInputActionOrigin_Switch_JoyConButton_W, // B
k_EInputActionOrigin_Switch_Reserved15,
k_EInputActionOrigin_Switch_Reserved16,
k_EInputActionOrigin_Switch_Reserved17,
@ -386,10 +386,10 @@ enum EInputActionOrigin
k_EInputActionOrigin_PS5_Gyro_Yaw,
k_EInputActionOrigin_PS5_Gyro_Roll,
k_EInputActionOrigin_PS5_DPad_Move,
k_EInputActionOrigin_PS5_Reserved1,
k_EInputActionOrigin_PS5_Reserved2,
k_EInputActionOrigin_PS5_Reserved3,
k_EInputActionOrigin_PS5_Reserved4,
k_EInputActionOrigin_PS5_LeftGrip,
k_EInputActionOrigin_PS5_RightGrip,
k_EInputActionOrigin_PS5_LeftFn,
k_EInputActionOrigin_PS5_RightFn,
k_EInputActionOrigin_PS5_Reserved5,
k_EInputActionOrigin_PS5_Reserved6,
k_EInputActionOrigin_PS5_Reserved7,
@ -643,12 +643,12 @@ struct InputDigitalActionData_t
struct InputMotionData_t
{
// Sensor-fused absolute rotation; will drift in heading
// Sensor-fused absolute rotation; will drift in heading toward average
float rotQuatX;
float rotQuatY;
float rotQuatZ;
float rotQuatW;
// Positional acceleration
float posAccelX;
float posAccelY;
@ -660,6 +660,58 @@ struct InputMotionData_t
float rotVelZ;
};
struct InputMotionDataV2_t
{
//
// Gyro post processing:
//
// Drift Corrected Quaternion is calculated after steam input controller calibration values have been applied.
// Rawest _useful_ version of a quaternion.
// Most camera implementations should use this by comparing last rotation against current rotation, and applying the difference to the in game camera (plus your own sensitivity tweaks)
// It is worth viewing
float driftCorrectedQuatX;
float driftCorrectedQuatY;
float driftCorrectedQuatZ;
float driftCorrectedQuatW;
// Sensor fusion corrects using accelerometer, and "average forward over time" for "forward".
// This can "ouija" your aim, so it's not so appropriate for camera controls (sensor fusion was originally made for racing game steering )
// Same result as from old InputMotionData_t::rotQuatX/Y/Z/W
float sensorFusionQuatX;
float sensorFusionQuatY;
float sensorFusionQuatZ;
float sensorFusionQuatW;
// Deferred Sensor fusion quaternion with deferred correction
// Reduces perception of "ouija" effect by only applying correction when the controller is below "low noise" thresholds,
// while the controller rotates fast - never when the user is attempting precision aim.
float deferredSensorFusionQuatX;
float deferredSensorFusionQuatY;
float deferredSensorFusionQuatZ;
float deferredSensorFusionQuatW;
// Same as accel but values are calibrated such that 1 unit = 1G.
// X = Right
// Y = Forward out through the joystick USB port.
// Z = Up through the joystick axis.
float gravityX;
float gravityY;
float gravityZ;
//
// Same as rotVel values in GetMotionData but values are calibrated to degrees per second.
// Local Space (controller relative)
// X = Pitch = left to right axis
// Y = Roll = axis through charging port
// Z = Yaw = axis through sticks
float degreesPerSecondX;
float degreesPerSecondY;
float degreesPerSecondZ;
};
//-----------------------------------------------------------------------------
// Purpose: when callbacks are enabled this fires each time a controller action
// state changes
@ -753,6 +805,12 @@ public:
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
STEAM_CALL_BACK( SteamInputDeviceDisconnected_t )
// Controllers using Gamepad emulation (XInput, DirectInput, etc) will be seated in the order that
// input is sent by the device. This callback will fire on first input for each device and when the
// a user has manually changed the order via the Steam overlay. This also has the device type info
// so that you can change out glyph sets without making additional API calls
STEAM_CALL_BACK( SteamInputGamepadSlotChange_t )
// Enable SteamInputActionEvent_t callbacks. Directly calls your callback function
// for lower latency than standard Steam callbacks. Supports one callback at a time.
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
@ -897,7 +955,7 @@ public:
// See isteamremoteplay.h for more information on Steam Remote Play sessions
virtual uint32 GetRemotePlaySessionID( InputHandle_t inputHandle ) = 0;
// Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.?
// Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.
// Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration
virtual uint16 GetSessionInputConfigurationSettings() = 0;
@ -957,6 +1015,20 @@ struct SteamInputConfigurationLoaded_t
bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings?
};
//-----------------------------------------------------------------------------
// Purpose: called when controller gamepad slots change - on Linux/macOS these
// slots are shared for all running apps.
//-----------------------------------------------------------------------------
struct SteamInputGamepadSlotChange_t
{
enum { k_iCallback = k_iSteamControllerCallbacks + 4 };
AppId_t m_unAppID;
InputHandle_t m_ulDeviceHandle; // Handle for device
ESteamInputType m_eDeviceType; // Type of device
int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings
int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings
};
#pragma pack( pop )
#endif // ISTEAMINPUT_H
#endif // ISTEAMINPUT_H

View File

@ -29,6 +29,7 @@ enum EParentalFeature
k_EFeatureLibrary = 11,
k_EFeatureTest = 12,
k_EFeatureSiteLicense = 13,
k_EFeatureKioskMode = 14,
k_EFeatureMax
};

View File

@ -51,7 +51,7 @@ public:
// This is set to 0x0 if the resolution is not available
virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0;
// Invite a friend to Remote Play Together
// Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty
// This returns false if the invite can't be sent
virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0;
};
@ -82,6 +82,11 @@ STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCa
STEAM_CALLBACK_END( 0 )
STEAM_CALLBACK_BEGIN( SteamRemotePlayTogetherGuestInvite_t, k_iSteamRemotePlayCallbacks + 3 )
STEAM_CALLBACK_MEMBER_ARRAY( 0, char, m_szConnectURL, 1024 )
STEAM_CALLBACK_END( 0 )
#pragma pack( pop )

View File

@ -157,6 +157,15 @@ enum EItemPreviewType
k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value
};
enum EUGCContentDescriptorID
{
k_EUGCContentDescriptor_NudityOrSexualContent = 1,
k_EUGCContentDescriptor_FrequentViolenceOrGore = 2,
k_EUGCContentDescriptor_AdultOnlySexualContent = 3,
k_EUGCContentDescriptor_GratuitousSexualContent = 4,
k_EUGCContentDescriptor_AnyMatureContent = 5,
};
const uint32 kNumUGCResultsPerPage = 50;
const uint32 k_cchDeveloperMetadataMax = 5000;
@ -237,6 +246,8 @@ public:
STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag )
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
virtual uint32 GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0;
// Release the request to free up memory, after retrieving results
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
@ -293,6 +304,8 @@ public:
virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item
virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
virtual bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0;
virtual bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0;
STEAM_CALL_RESULT( SubmitItemUpdateResult_t )
virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate()
@ -371,7 +384,7 @@ public:
virtual SteamAPICall_t GetWorkshopEULAStatus() = 0;
};
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION016"
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION017"
// Global interface accessor
inline ISteamUGC *SteamUGC();

View File

@ -124,7 +124,16 @@ public:
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
// pcbTicket retrieves the length of the actual ticket.
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
// SteamNetworkingIdentity is an optional input parameter to hold the public IP address or SteamID of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
// if a Steam ID is passed Steam will only allow the ticket to be used by that Steam ID
// not to be used for "ISteamUserAuth\AuthenticateUserTicket" - it will fail
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0;
// Request a ticket which will be used for webapi "ISteamUserAuth\AuthenticateUserTicket"
// pchIdentity is an optional input parameter to identify the service the ticket will be sent to
// the ticket will be returned in callback GetTicketForWebApiResponse_t
virtual HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity ) = 0;
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
@ -210,7 +219,7 @@ public:
};
#define STEAMUSER_INTERFACE_VERSION "SteamUser021"
#define STEAMUSER_INTERFACE_VERSION "SteamUser023"
// Global interface accessor
inline ISteamUser *SteamUser();
@ -225,12 +234,13 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFA
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
//-----------------------------------------------------------------------------
// Purpose: called when a connections to the Steam back-end has been established
// this means the Steam client now has a working connection to the Steam servers
// usually this will have occurred before the game has launched, and should
// Purpose: Called when an authenticated connection to the Steam back-end has been established.
// This means the Steam client now has a working connection to the Steam servers.
// Usually this will have occurred before the game has launched, and should
// only be seen if the user has dropped connection due to a networking issue
// or a Steam server update
// or a Steam server update.
//-----------------------------------------------------------------------------
struct SteamServersConnected_t
{
@ -350,7 +360,6 @@ struct GetAuthSessionTicketResponse_t
EResult m_eResult;
};
//-----------------------------------------------------------------------------
// Purpose: sent to your game in response to a steam://gamewebcallback/ command
//-----------------------------------------------------------------------------
@ -411,6 +420,20 @@ struct DurationControl_t
};
//-----------------------------------------------------------------------------
// callback for GetTicketForWebApi
//-----------------------------------------------------------------------------
struct GetTicketForWebApiResponse_t
{
enum { k_iCallback = k_iSteamUserCallbacks + 68 };
HAuthTicket m_hAuthTicket;
EResult m_eResult;
int m_cubTicket;
static const int k_nCubTicketMaxLength = 2560;
uint8 m_rgubTicket[k_nCubTicketMaxLength];
};
#pragma pack( pop )
#endif // ISTEAMUSER_H

View File

@ -6,9 +6,6 @@
#ifndef ISTEAMUTILS_H
#define ISTEAMUTILS_H
#ifdef _WIN32
#pragma once
#endif
#include "steam_api_common.h"
@ -60,12 +57,6 @@ enum ETextFilteringContext
};
// function prototype for warning message hook
#if defined( POSIX )
#define __cdecl
#endif
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
//-----------------------------------------------------------------------------
// Purpose: interface to user independent utility functions
//-----------------------------------------------------------------------------
@ -317,6 +308,7 @@ struct GamepadTextInputDismissed_t
enum { k_iCallback = k_iSteamUtilsCallbacks + 14 };
bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input
uint32 m_unSubmittedText;
AppId_t m_unAppID;
};
// k_iSteamUtilsCallbacks + 15 through 35 are taken
@ -334,6 +326,15 @@ struct FloatingGamepadTextInputDismissed_t
enum { k_iCallback = k_iSteamUtilsCallbacks + 38 };
};
//-----------------------------------------------------------------------------
// The text filtering dictionary has changed
//-----------------------------------------------------------------------------
struct FilterTextDictionaryChanged_t
{
enum { k_iCallback = k_iSteamUtilsCallbacks + 39 };
int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering
};
#pragma pack( pop )
#endif // ISTEAMUTILS_H

View File

@ -8,16 +8,6 @@
#ifndef MATCHMAKINGTYPES_H
#define MATCHMAKINGTYPES_H
#ifdef _WIN32
#pragma once
#endif
#ifdef POSIX
#ifndef _snprintf
#define _snprintf snprintf
#endif
#endif
#include <stdio.h>
#include <string.h>
@ -68,9 +58,6 @@ public:
servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {}
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
#ifdef NETADR_H
netadr_t GetIPAndQueryPort();
#endif
// Access the query port.
uint16 GetQueryPort() const;
@ -113,13 +100,6 @@ inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 us
m_usConnectionPort = usConnectionPort;
}
#ifdef NETADR_H
inline netadr_t servernetadr_t::GetIPAndQueryPort()
{
return netadr_t( m_unIP, m_usQueryPort );
}
#endif
inline uint16 servernetadr_t::GetQueryPort() const
{
return m_usQueryPort;
@ -156,9 +136,9 @@ inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
static int nBuf = 0;
unsigned char *ipByte = (unsigned char *)&unIP;
#ifdef VALVE_BIG_ENDIAN
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort );
snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort );
#else
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
#endif
const char *pchRet = s[nBuf];
++nBuf;

View File

@ -125,6 +125,16 @@
],
"struct": "DurationControl_t"
},
{
"callback_id": 168,
"fields": [
{ "fieldname":"m_hAuthTicket", "fieldtype":"HAuthTicket" },
{ "fieldname":"m_eResult", "fieldtype":"EResult" },
{ "fieldname":"m_cubTicket", "fieldtype":"int" },
{ "fieldname":"m_rgubTicket", "fieldtype":"uint8 [2560]" }
],
"struct": "GetTicketForWebApiResponse_t"
},
{
"callback_id": 304,
"fields": [
@ -136,7 +146,9 @@
{
"callback_id": 331,
"fields": [
{ "fieldname":"m_bActive", "fieldtype":"uint8" }
{ "fieldname":"m_bActive", "fieldtype":"uint8" },
{ "fieldname":"m_bUserInitiated", "fieldtype":"bool" },
{ "fieldname":"m_nAppID", "fieldtype":"AppId_t" }
],
"struct": "GameOverlayActivated_t"
},
@ -347,7 +359,8 @@
"callback_id": 714,
"fields": [
{ "fieldname":"m_bSubmitted", "fieldtype":"bool" },
{ "fieldname":"m_unSubmittedText", "fieldtype":"uint32" }
{ "fieldname":"m_unSubmittedText", "fieldtype":"uint32" },
{ "fieldname":"m_unAppID", "fieldtype":"AppId_t" }
],
"struct": "GamepadTextInputDismissed_t"
},
@ -361,6 +374,13 @@
"fields": [],
"struct": "FloatingGamepadTextInputDismissed_t"
},
{
"callback_id": 739,
"fields": [
{ "fieldname":"m_eLanguage", "fieldtype":"int" }
],
"struct": "FilterTextDictionaryChanged_t"
},
{
"callback_id": 502,
"fields": [
@ -968,14 +988,6 @@
],
"struct": "DlcInstalled_t"
},
{
"callback_id": 1008,
"fields": [
{ "fieldname":"m_eResult", "fieldtype":"ERegisterActivationCodeResult" },
{ "fieldname":"m_unPackageRegistered", "fieldtype":"uint32" }
],
"struct": "RegisterActivationCodeResponse_t"
},
{
"callback_id": 1014,
"fields": [],
@ -1199,6 +1211,17 @@
],
"struct": "SteamInputConfigurationLoaded_t"
},
{
"callback_id": 2804,
"fields": [
{ "fieldname":"m_unAppID", "fieldtype":"AppId_t" },
{ "fieldname":"m_ulDeviceHandle", "fieldtype":"InputHandle_t" },
{ "fieldname":"m_eDeviceType", "fieldtype":"ESteamInputType" },
{ "fieldname":"m_nOldGamepadSlot", "fieldtype":"int" },
{ "fieldname":"m_nNewGamepadSlot", "fieldtype":"int" }
],
"struct": "SteamInputGamepadSlotChange_t"
},
{
"callback_id": 3401,
"fields": [
@ -1689,6 +1712,13 @@
],
"struct": "SteamRemotePlaySessionDisconnected_t"
},
{
"callback_id": 5703,
"fields": [
{ "fieldname":"m_szConnectURL", "fieldtype":"char [1024]" }
],
"struct": "SteamRemotePlayTogetherGuestInvite_t"
},
{
"callback_id": 1251,
"fields": [
@ -2162,7 +2192,8 @@
{ "name":"k_EAuthSessionResponseAuthTicketCanceled", "value":"6" },
{ "name":"k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed", "value":"7" },
{ "name":"k_EAuthSessionResponseAuthTicketInvalid", "value":"8" },
{ "name":"k_EAuthSessionResponsePublisherIssuedBan", "value":"9" }
{ "name":"k_EAuthSessionResponsePublisherIssuedBan", "value":"9" },
{ "name":"k_EAuthSessionResponseAuthTicketNetworkIdentityFailure", "value":"10" }
]
},
{
@ -2236,6 +2267,7 @@
{
"enumname": "ENotificationPosition",
"values": [
{ "name":"k_EPositionInvalid", "value":"-1" },
{ "name":"k_EPositionTopLeft", "value":"0" },
{ "name":"k_EPositionTopRight", "value":"1" },
{ "name":"k_EPositionBottomLeft", "value":"2" },
@ -2743,16 +2775,6 @@
{ "name":"k_ELeaderboardUploadScoreMethodForceUpdate", "value":"2" }
]
},
{
"enumname": "ERegisterActivationCodeResult",
"values": [
{ "name":"k_ERegisterActivationCodeResultOK", "value":"0" },
{ "name":"k_ERegisterActivationCodeResultFail", "value":"1" },
{ "name":"k_ERegisterActivationCodeResultAlreadyRegistered", "value":"2" },
{ "name":"k_ERegisterActivationCodeResultTimeout", "value":"3" },
{ "name":"k_ERegisterActivationCodeAlreadyOwned", "value":"4" }
]
},
{
"enumname": "EP2PSessionError",
"values": [
@ -2850,6 +2872,7 @@
{ "name":"k_EHTTPStatusCode304NotModified", "value":"304" },
{ "name":"k_EHTTPStatusCode305UseProxy", "value":"305" },
{ "name":"k_EHTTPStatusCode307TemporaryRedirect", "value":"307" },
{ "name":"k_EHTTPStatusCode308PermanentRedirect", "value":"308" },
{ "name":"k_EHTTPStatusCode400BadRequest", "value":"400" },
{ "name":"k_EHTTPStatusCode401Unauthorized", "value":"401" },
{ "name":"k_EHTTPStatusCode402PaymentRequired", "value":"402" },
@ -3153,10 +3176,10 @@
{ "name":"k_EInputActionOrigin_Switch_LeftGrip_Upper", "value":"245" },
{ "name":"k_EInputActionOrigin_Switch_RightGrip_Lower", "value":"246" },
{ "name":"k_EInputActionOrigin_Switch_RightGrip_Upper", "value":"247" },
{ "name":"k_EInputActionOrigin_Switch_Reserved11", "value":"248" },
{ "name":"k_EInputActionOrigin_Switch_Reserved12", "value":"249" },
{ "name":"k_EInputActionOrigin_Switch_Reserved13", "value":"250" },
{ "name":"k_EInputActionOrigin_Switch_Reserved14", "value":"251" },
{ "name":"k_EInputActionOrigin_Switch_JoyConButton_N", "value":"248" },
{ "name":"k_EInputActionOrigin_Switch_JoyConButton_E", "value":"249" },
{ "name":"k_EInputActionOrigin_Switch_JoyConButton_S", "value":"250" },
{ "name":"k_EInputActionOrigin_Switch_JoyConButton_W", "value":"251" },
{ "name":"k_EInputActionOrigin_Switch_Reserved15", "value":"252" },
{ "name":"k_EInputActionOrigin_Switch_Reserved16", "value":"253" },
{ "name":"k_EInputActionOrigin_Switch_Reserved17", "value":"254" },
@ -3218,10 +3241,10 @@
{ "name":"k_EInputActionOrigin_PS5_Gyro_Yaw", "value":"310" },
{ "name":"k_EInputActionOrigin_PS5_Gyro_Roll", "value":"311" },
{ "name":"k_EInputActionOrigin_PS5_DPad_Move", "value":"312" },
{ "name":"k_EInputActionOrigin_PS5_Reserved1", "value":"313" },
{ "name":"k_EInputActionOrigin_PS5_Reserved2", "value":"314" },
{ "name":"k_EInputActionOrigin_PS5_Reserved3", "value":"315" },
{ "name":"k_EInputActionOrigin_PS5_Reserved4", "value":"316" },
{ "name":"k_EInputActionOrigin_PS5_LeftGrip", "value":"313" },
{ "name":"k_EInputActionOrigin_PS5_RightGrip", "value":"314" },
{ "name":"k_EInputActionOrigin_PS5_LeftFn", "value":"315" },
{ "name":"k_EInputActionOrigin_PS5_RightFn", "value":"316" },
{ "name":"k_EInputActionOrigin_PS5_Reserved5", "value":"317" },
{ "name":"k_EInputActionOrigin_PS5_Reserved6", "value":"318" },
{ "name":"k_EInputActionOrigin_PS5_Reserved7", "value":"319" },
@ -3818,7 +3841,15 @@
{ "name":"k_EControllerActionOrigin_SteamDeck_Reserved18", "value":"375" },
{ "name":"k_EControllerActionOrigin_SteamDeck_Reserved19", "value":"376" },
{ "name":"k_EControllerActionOrigin_SteamDeck_Reserved20", "value":"377" },
{ "name":"k_EControllerActionOrigin_Count", "value":"378" },
{ "name":"k_EControllerActionOrigin_Switch_JoyConButton_N", "value":"378" },
{ "name":"k_EControllerActionOrigin_Switch_JoyConButton_E", "value":"379" },
{ "name":"k_EControllerActionOrigin_Switch_JoyConButton_S", "value":"380" },
{ "name":"k_EControllerActionOrigin_Switch_JoyConButton_W", "value":"381" },
{ "name":"k_EControllerActionOrigin_PS5_LeftGrip", "value":"382" },
{ "name":"k_EControllerActionOrigin_PS5_RightGrip", "value":"383" },
{ "name":"k_EControllerActionOrigin_PS5_LeftFn", "value":"384" },
{ "name":"k_EControllerActionOrigin_PS5_RightFn", "value":"385" },
{ "name":"k_EControllerActionOrigin_Count", "value":"386" },
{ "name":"k_EControllerActionOrigin_MaximumPossibleValue", "value":"32767" }
]
},
@ -3951,6 +3982,16 @@
{ "name":"k_EItemPreviewType_ReservedMax", "value":"255" }
]
},
{
"enumname": "EUGCContentDescriptorID",
"values": [
{ "name":"k_EUGCContentDescriptor_NudityOrSexualContent", "value":"1" },
{ "name":"k_EUGCContentDescriptor_FrequentViolenceOrGore", "value":"2" },
{ "name":"k_EUGCContentDescriptor_AdultOnlySexualContent", "value":"3" },
{ "name":"k_EUGCContentDescriptor_GratuitousSexualContent", "value":"4" },
{ "name":"k_EUGCContentDescriptor_AnyMatureContent", "value":"5" }
]
},
{
"enumname": "ESteamItemFlags",
"values": [
@ -3976,7 +4017,8 @@
{ "name":"k_EFeatureLibrary", "value":"11" },
{ "name":"k_EFeatureTest", "value":"12" },
{ "name":"k_EFeatureSiteLicense", "value":"13" },
{ "name":"k_EFeatureMax", "value":"14" }
{ "name":"k_EFeatureKioskMode", "value":"14" },
{ "name":"k_EFeatureMax", "value":"15" }
]
},
{
@ -4556,7 +4598,7 @@
{
"kind": "user",
"name": "SteamUser",
"name_flat": "SteamAPI_SteamUser_v021"
"name_flat": "SteamAPI_SteamUser_v023"
}
],
"classname": "ISteamUser",
@ -4685,7 +4727,16 @@
"params": [
{ "paramname":"pTicket", "paramtype":"void *" },
{ "paramname":"cbMaxTicket", "paramtype":"int" },
{ "paramname":"pcbTicket", "paramtype":"uint32 *" }
{ "paramname":"pcbTicket", "paramtype":"uint32 *" },
{ "paramname":"pSteamNetworkingIdentity", "paramtype":"const SteamNetworkingIdentity *" }
],
"returntype": "HAuthTicket"
},
{
"methodname": "GetAuthTicketForWebApi",
"methodname_flat": "SteamAPI_ISteamUser_GetAuthTicketForWebApi",
"params": [
{ "paramname":"pchIdentity", "paramtype":"const char *" }
],
"returntype": "HAuthTicket"
},
@ -4831,7 +4882,7 @@
"returntype": "bool"
}
],
"version_string": "SteamUser021"
"version_string": "SteamUser023"
},
{
"accessors": [
@ -9021,7 +9072,7 @@
"returntype": "void"
},
{
"callback": "SteamInputDeviceDisconnected_t",
"callback": "SteamInputGamepadSlotChange_t",
"methodname": "EnableActionEventCallbacks",
"methodname_flat": "SteamAPI_ISteamInput_EnableActionEventCallbacks",
"params": [
@ -9735,12 +9786,12 @@
{
"kind": "user",
"name": "SteamUGC",
"name_flat": "SteamAPI_SteamUGC_v016"
"name_flat": "SteamAPI_SteamUGC_v017"
},
{
"kind": "gameserver",
"name": "SteamGameServerUGC",
"name_flat": "SteamAPI_SteamGameServerUGC_v016"
"name_flat": "SteamAPI_SteamGameServerUGC_v017"
}
],
"classname": "ISteamUGC",
@ -9984,6 +10035,17 @@
],
"returntype": "bool"
},
{
"methodname": "GetQueryUGCContentDescriptors",
"methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors",
"params": [
{ "paramname":"handle", "paramtype":"UGCQueryHandle_t" },
{ "paramname":"index", "paramtype":"uint32" },
{ "paramname":"pvecDescriptors", "paramtype":"EUGCContentDescriptorID *" },
{ "paramname":"cMaxEntries", "paramtype":"uint32" }
],
"returntype": "uint32"
},
{
"methodname": "ReleaseQueryUGCRequest",
"methodname_flat": "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest",
@ -10360,6 +10422,24 @@
],
"returntype": "bool"
},
{
"methodname": "AddContentDescriptor",
"methodname_flat": "SteamAPI_ISteamUGC_AddContentDescriptor",
"params": [
{ "paramname":"handle", "paramtype":"UGCUpdateHandle_t" },
{ "paramname":"descid", "paramtype":"EUGCContentDescriptorID" }
],
"returntype": "bool"
},
{
"methodname": "RemoveContentDescriptor",
"methodname_flat": "SteamAPI_ISteamUGC_RemoveContentDescriptor",
"params": [
{ "paramname":"handle", "paramtype":"UGCUpdateHandle_t" },
{ "paramname":"descid", "paramtype":"EUGCContentDescriptorID" }
],
"returntype": "bool"
},
{
"callresult": "SubmitItemUpdateResult_t",
"methodname": "SubmitItemUpdate",
@ -10611,7 +10691,7 @@
"returntype": "SteamAPICall_t"
}
],
"version_string": "STEAMUGC_INTERFACE_VERSION016"
"version_string": "STEAMUGC_INTERFACE_VERSION017"
},
{
"accessors": [
@ -12675,7 +12755,7 @@
{
"kind": "gameserver",
"name": "SteamGameServer",
"name_flat": "SteamAPI_SteamGameServer_v014"
"name_flat": "SteamAPI_SteamGameServer_v015"
}
],
"classname": "ISteamGameServer",
@ -12867,7 +12947,8 @@
"params": [
{ "paramname":"pTicket", "paramtype":"void *" },
{ "paramname":"cbMaxTicket", "paramtype":"int" },
{ "paramname":"pcbTicket", "paramtype":"uint32 *" }
{ "paramname":"pcbTicket", "paramtype":"uint32 *" },
{ "paramname":"pSnid", "paramtype":"const SteamNetworkingIdentity *" }
],
"returntype": "HAuthTicket"
},
@ -13011,7 +13092,7 @@
"returntype": "bool"
}
],
"version_string": "SteamGameServer014"
"version_string": "SteamGameServer015"
},
{
"accessors": [
@ -13431,6 +13512,29 @@
],
"struct": "InputMotionData_t"
},
{
"fields": [
{ "fieldname":"driftCorrectedQuatX", "fieldtype":"float" },
{ "fieldname":"driftCorrectedQuatY", "fieldtype":"float" },
{ "fieldname":"driftCorrectedQuatZ", "fieldtype":"float" },
{ "fieldname":"driftCorrectedQuatW", "fieldtype":"float" },
{ "fieldname":"sensorFusionQuatX", "fieldtype":"float" },
{ "fieldname":"sensorFusionQuatY", "fieldtype":"float" },
{ "fieldname":"sensorFusionQuatZ", "fieldtype":"float" },
{ "fieldname":"sensorFusionQuatW", "fieldtype":"float" },
{ "fieldname":"deferredSensorFusionQuatX", "fieldtype":"float" },
{ "fieldname":"deferredSensorFusionQuatY", "fieldtype":"float" },
{ "fieldname":"deferredSensorFusionQuatZ", "fieldtype":"float" },
{ "fieldname":"deferredSensorFusionQuatW", "fieldtype":"float" },
{ "fieldname":"gravityX", "fieldtype":"float" },
{ "fieldname":"gravityY", "fieldtype":"float" },
{ "fieldname":"gravityZ", "fieldtype":"float" },
{ "fieldname":"degreesPerSecondX", "fieldtype":"float" },
{ "fieldname":"degreesPerSecondY", "fieldtype":"float" },
{ "fieldname":"degreesPerSecondZ", "fieldtype":"float" }
],
"struct": "InputMotionDataV2_t"
},
{
"fields": [
{ "fieldname":"controllerHandle", "fieldtype":"InputHandle_t" },

View File

@ -9,9 +9,6 @@
#ifndef STEAM_API_COMMON_H
#define STEAM_API_COMMON_H
#ifdef _WIN32
#pragma once
#endif
#include "steamtypes.h"
#include "steamclientpublic.h"
@ -25,7 +22,7 @@
#else
#define S_API extern "C" __declspec( dllimport )
#endif // STEAM_API_EXPORTS
#elif defined( GNUC )
#elif defined( __GNUC__ )
#if defined( STEAM_API_EXPORTS )
#define S_API extern "C" __attribute__ ((visibility("default")))
#else
@ -51,12 +48,18 @@
typedef int32 HSteamPipe;
// handle to single instance of a steam user
typedef int32 HSteamUser;
// function prototype
#if defined( POSIX )
#define __cdecl
// #define away __cdecl on posix.
// This is really, really bad. We're sorry. But it's been this way for
// a long time now and it's scary to change it, as there may be others that
// depend on it.
#ifndef _WIN32
#define __cdecl
#endif
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum );
// function prototype
extern "C" typedef void ( S_CALLTYPE *SteamAPIWarningMessageHook_t )( int, const char * );
extern "C" typedef uint32 ( S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum );
#if defined( __SNC__ )
#pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor
#endif

View File

@ -58,9 +58,9 @@ S_API ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay( ISteamClient
// ISteamUser
// A versioned accessor is exported by the library
S_API ISteamUser *SteamAPI_SteamUser_v021();
S_API ISteamUser *SteamAPI_SteamUser_v023();
// Inline, unversioned accessor to get the current version. Essentially the same as SteamUser(), but using this ensures that you are using a matching library.
inline ISteamUser *SteamAPI_SteamUser() { return SteamAPI_SteamUser_v021(); }
inline ISteamUser *SteamAPI_SteamUser() { return SteamAPI_SteamUser_v023(); }
S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser( ISteamUser* self );
S_API bool SteamAPI_ISteamUser_BLoggedOn( ISteamUser* self );
S_API uint64_steamid SteamAPI_ISteamUser_GetSteamID( ISteamUser* self );
@ -74,7 +74,8 @@ S_API EVoiceResult SteamAPI_ISteamUser_GetAvailableVoice( ISteamUser* self, uint
S_API EVoiceResult SteamAPI_ISteamUser_GetVoice( ISteamUser* self, bool bWantCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, bool bWantUncompressed_Deprecated, void * pUncompressedDestBuffer_Deprecated, uint32 cbUncompressedDestBufferSize_Deprecated, uint32 * nUncompressBytesWritten_Deprecated, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated );
S_API EVoiceResult SteamAPI_ISteamUser_DecompressVoice( ISteamUser* self, const void * pCompressed, uint32 cbCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, uint32 nDesiredSampleRate );
S_API uint32 SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( ISteamUser* self );
S_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket );
S_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSteamNetworkingIdentity );
S_API HAuthTicket SteamAPI_ISteamUser_GetAuthTicketForWebApi( ISteamUser* self, const char * pchIdentity );
S_API EBeginAuthSessionResult SteamAPI_ISteamUser_BeginAuthSession( ISteamUser* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID );
S_API void SteamAPI_ISteamUser_EndAuthSession( ISteamUser* self, uint64_steamid steamID );
S_API void SteamAPI_ISteamUser_CancelAuthTicket( ISteamUser* self, HAuthTicket hAuthTicket );
@ -753,14 +754,14 @@ S_API bool SteamAPI_ISteamController_GetControllerBindingRevision( ISteamControl
// ISteamUGC
// A versioned accessor is exported by the library
S_API ISteamUGC *SteamAPI_SteamUGC_v016();
S_API ISteamUGC *SteamAPI_SteamUGC_v017();
// Inline, unversioned accessor to get the current version. Essentially the same as SteamUGC(), but using this ensures that you are using a matching library.
inline ISteamUGC *SteamAPI_SteamUGC() { return SteamAPI_SteamUGC_v016(); }
inline ISteamUGC *SteamAPI_SteamUGC() { return SteamAPI_SteamUGC_v017(); }
// A versioned accessor is exported by the library
S_API ISteamUGC *SteamAPI_SteamGameServerUGC_v016();
S_API ISteamUGC *SteamAPI_SteamGameServerUGC_v017();
// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerUGC(), but using this ensures that you are using a matching library.
inline ISteamUGC *SteamAPI_SteamGameServerUGC() { return SteamAPI_SteamGameServerUGC_v016(); }
inline ISteamUGC *SteamAPI_SteamGameServerUGC() { return SteamAPI_SteamGameServerUGC_v017(); }
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage );
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage );
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor );
@ -779,6 +780,7 @@ S_API bool SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( ISteamUGC* self, UGC
S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index );
S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char * pchKey, uint32 cchKeySize, char * pchValue, uint32 cchValueSize );
S_API bool SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, const char * pchKey, char * pchValue, uint32 cchValueSize );
S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries );
S_API bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( ISteamUGC* self, UGCQueryHandle_t handle );
S_API bool SteamAPI_ISteamUGC_AddRequiredTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pTagName );
S_API bool SteamAPI_ISteamUGC_AddRequiredTagGroup( ISteamUGC* self, UGCQueryHandle_t handle, const SteamParamStringArray_t * pTagGroups );
@ -820,6 +822,8 @@ S_API bool SteamAPI_ISteamUGC_AddItemPreviewVideo( ISteamUGC* self, UGCUpdateHan
S_API bool SteamAPI_ISteamUGC_UpdateItemPreviewFile( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index, const char * pszPreviewFile );
S_API bool SteamAPI_ISteamUGC_UpdateItemPreviewVideo( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index, const char * pszVideoID );
S_API bool SteamAPI_ISteamUGC_RemoveItemPreview( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index );
S_API bool SteamAPI_ISteamUGC_AddContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid );
S_API bool SteamAPI_ISteamUGC_RemoveContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid );
S_API SteamAPICall_t SteamAPI_ISteamUGC_SubmitItemUpdate( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchChangeNote );
S_API EItemUpdateStatus SteamAPI_ISteamUGC_GetItemUpdateProgress( ISteamUGC* self, UGCUpdateHandle_t handle, uint64 * punBytesProcessed, uint64 * punBytesTotal );
S_API SteamAPICall_t SteamAPI_ISteamUGC_SetUserItemVote( ISteamUGC* self, PublishedFileId_t nPublishedFileID, bool bVoteUp );
@ -1120,9 +1124,9 @@ S_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString( I
// ISteamGameServer
// A versioned accessor is exported by the library
S_API ISteamGameServer *SteamAPI_SteamGameServer_v014();
S_API ISteamGameServer *SteamAPI_SteamGameServer_v015();
// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServer(), but using this ensures that you are using a matching library.
inline ISteamGameServer *SteamAPI_SteamGameServer() { return SteamAPI_SteamGameServer_v014(); }
inline ISteamGameServer *SteamAPI_SteamGameServer() { return SteamAPI_SteamGameServer_v015(); }
S_API void SteamAPI_ISteamGameServer_SetProduct( ISteamGameServer* self, const char * pszProduct );
S_API void SteamAPI_ISteamGameServer_SetGameDescription( ISteamGameServer* self, const char * pszGameDescription );
S_API void SteamAPI_ISteamGameServer_SetModDir( ISteamGameServer* self, const char * pszModDir );
@ -1147,7 +1151,7 @@ S_API void SteamAPI_ISteamGameServer_SetGameTags( ISteamGameServer* self, const
S_API void SteamAPI_ISteamGameServer_SetGameData( ISteamGameServer* self, const char * pchGameData );
S_API void SteamAPI_ISteamGameServer_SetRegion( ISteamGameServer* self, const char * pszRegion );
S_API void SteamAPI_ISteamGameServer_SetAdvertiseServerActive( ISteamGameServer* self, bool bActive );
S_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket( ISteamGameServer* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket );
S_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket( ISteamGameServer* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSnid );
S_API EBeginAuthSessionResult SteamAPI_ISteamGameServer_BeginAuthSession( ISteamGameServer* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID );
S_API void SteamAPI_ISteamGameServer_EndAuthSession( ISteamGameServer* self, uint64_steamid steamID );
S_API void SteamAPI_ISteamGameServer_CancelAuthTicket( ISteamGameServer* self, HAuthTicket hAuthTicket );

View File

@ -54,12 +54,6 @@ S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallbac
S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
// disable this warning; this pattern need for steam callback registration
#ifdef _MSVC_VER
#pragma warning( push )
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
#endif
#define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param )
#define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED
#define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y
@ -244,6 +238,9 @@ class ISteamInput;
class ISteamParties;
class ISteamRemotePlay;
// Forward declare types
struct SteamNetworkingIdentity;
//-----------------------------------------------------------------------------
// Purpose: Base values for callback identifiers, each callback must
// have a unique ID.
@ -289,10 +286,6 @@ enum { k_iSteamRemotePlayCallbacks = 5700 };
enum { k_iSteamChatCallbacks = 5900 };
// NOTE: Internal "IClientXxx" callback IDs go in clientenums.h
#ifdef _MSVC_VER
#pragma warning( pop )
#endif
// Macros used to annotate various Steamworks interfaces to generate the
// flat API
#ifdef API_GEN

View File

@ -79,7 +79,7 @@ enum EResult
k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure
k_EResultCannotUseOldPassword = 64, // The requested new password is not legal
k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent - partner site specific
k_EResultHardwareNotCapableOfIPT = 67, //
k_EResultIPTInitError = 68, //
k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user
@ -208,6 +208,7 @@ enum EAuthSessionResponse
k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam.
k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC
k_EAuthSessionResponseAuthTicketNetworkIdentityFailure = 10, // The network identity in the ticket does not match the server authenticating the ticket
};
// results from UserHasLicenseForApp
@ -310,6 +311,7 @@ enum EChatSteamIDInstanceFlags
//-----------------------------------------------------------------------------
enum ENotificationPosition
{
k_EPositionInvalid = -1,
k_EPositionTopLeft = 0,
k_EPositionTopRight = 1,
k_EPositionBottomLeft = 2,
@ -908,6 +910,14 @@ class CGameID
{
public:
enum EGameIDType
{
k_EGameIDTypeApp = 0,
k_EGameIDTypeGameMod = 1,
k_EGameIDTypeShortcut = 2,
k_EGameIDTypeP2P = 3,
};
CGameID()
{
m_gameID.m_nType = k_EGameIDTypeApp;
@ -938,12 +948,12 @@ public:
m_gameID.m_nAppID = nAppID;
}
CGameID( uint32 nAppID, uint32 nModID )
// Not validating anything .. use IsValid()
explicit CGameID( uint32 nAppID, uint32 nModID, CGameID::EGameIDType nType )
{
m_ulGameID = 0;
m_gameID.m_nAppID = nAppID;
m_gameID.m_nModID = nModID;
m_gameID.m_nType = k_EGameIDTypeGameMod;
m_gameID.m_nType = nType;
}
CGameID( const CGameID &that )
@ -1002,10 +1012,14 @@ public:
return m_gameID.m_nModID;
}
uint32 AppID() const
#if !defined(VALVE_SHORTCUT_DEBUG)
uint32 AppID( bool = false ) const
{
return m_gameID.m_nAppID;
}
#else
uint32 AppID( bool bShortcutOK = false ) const;
#endif
bool operator == ( const CGameID &rhs ) const
{
@ -1031,13 +1045,15 @@ public:
return m_gameID.m_nAppID != k_uAppIdInvalid;
case k_EGameIDTypeGameMod:
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
return m_gameID.m_nAppID != k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000);
case k_EGameIDTypeShortcut:
return (m_gameID.m_nModID & 0x80000000) != 0;
return m_gameID.m_nAppID == k_uAppIdInvalid
&& (m_gameID.m_nModID & 0x80000000)
&& m_gameID.m_nModID >= (5000 | 0x80000000); // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range
case k_EGameIDTypeP2P:
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
return m_gameID.m_nAppID == k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000);
default:
return false;
@ -1054,14 +1070,6 @@ public:
// Internal stuff. Use the accessors above if possible
//
enum EGameIDType
{
k_EGameIDTypeApp = 0,
k_EGameIDTypeGameMod = 1,
k_EGameIDTypeShortcut = 2,
k_EGameIDTypeP2P = 3,
};
struct GameID_t
{
#ifdef VALVE_BIG_ENDIAN
@ -1080,6 +1088,8 @@ public:
uint64 m_ulGameID;
GameID_t m_gameID;
};
friend CGameID GameIDFromAppAndModPath( uint32 nAppID, const char *pchModPath );
};
#pragma pack( pop )
@ -1135,7 +1145,7 @@ enum ESteamIPv6ConnectivityState
// Define compile time assert macros to let us validate the structure sizes.
#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1];
#if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
// The 32-bit version of gcc has the alignment requirement for uint64 and double set to
// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
// The 64-bit version of gcc has the alignment requirement for these types set to

View File

@ -62,6 +62,7 @@ enum EHTTPStatusCode
k_EHTTPStatusCode305UseProxy = 305,
//k_EHTTPStatusCode306Unused = 306, (used in old HTTP spec, now unused in 1.1)
k_EHTTPStatusCode307TemporaryRedirect = 307,
k_EHTTPStatusCode308PermanentRedirect = 308,
// Error codes
k_EHTTPStatusCode400BadRequest = 400,

View File

@ -1699,7 +1699,7 @@ inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char
//
// There is also extra paranoia to make sure the bytes are not treated as signed.
SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U;
if ( pszCode[1] )
if ( result && pszCode[1] )
{
result |= ( (uint32)(uint8)pszCode[1] << 8U );
if ( pszCode[2] )
@ -1716,9 +1716,7 @@ inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char
template <int N>
inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] )
{
#if !defined( __GNUC__ ) || __GNUC__ >= 5
static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" );
#endif
szCode[0] = char( id >> 16U );
szCode[1] = char( id >> 8U );
szCode[2] = char( id );

View File

@ -1,27 +1,20 @@
//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============
//
// Purpose:
//
//=============================================================================
//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============
#ifndef STEAMTYPES_H
#define STEAMTYPES_H
#ifdef _WIN32
#pragma once
#endif
#define S_CALLTYPE __cdecl
// WARNING: __cdecl is potentially #defined away in steam_api_common.h
// Steam-specific types. Defined here so this header file can be included in other code bases.
#ifndef WCHARTYPES_H
typedef unsigned char uint8;
#endif
#if defined( __GNUC__ ) && !defined(_WIN32) && !defined(POSIX)
#ifdef __GNUC__
#if __GNUC__ < 4
#error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)"
#endif
#define POSIX 1
#endif
#if defined(__LP64__) || defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) || defined(__s390x__)