Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added missing ShowFloatingGamepadTextInput #720

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Facepunch.Steamworks.Test/GameServerTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data;

namespace Steamworks
{
Expand Down Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions Facepunch.Steamworks.Test/UserTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data;

namespace Steamworks
{
Expand Down Expand Up @@ -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 );
Expand All @@ -78,14 +79,25 @@ 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 );
Console.WriteLine( $"ticket.Handle: {ticket.Handle}" );
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()
{
Expand Down
Binary file modified Facepunch.Steamworks.Test/steam_api.dll
Binary file not shown.
Binary file modified Facepunch.Steamworks.Test/steam_api64.dll
Binary file not shown.
10 changes: 8 additions & 2 deletions Facepunch.Steamworks/Generated/CustomEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum CallbackType
StoreAuthURLResponse = 165,
MarketEligibilityResponse = 166,
DurationControl = 167,
GetTicketForWebApiResponse = 168,
GSClientApprove = 201,
GSClientDeny = 202,
GSClientKick = 203,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -138,6 +139,7 @@ public enum CallbackType
SteamInputDeviceConnected = 2801,
SteamInputDeviceDisconnected = 2802,
SteamInputConfigurationLoaded = 2803,
SteamInputGamepadSlotChange = 2804,
SteamUGCQueryCompleted = 3401,
SteamUGCRequestUGCDetailsResult = 3402,
CreateItemResult = 3403,
Expand Down Expand Up @@ -222,6 +224,7 @@ public enum CallbackType
ActiveBeaconsUpdated = 5306,
SteamRemotePlaySessionConnected = 5701,
SteamRemotePlaySessionDisconnected = 5702,
SteamRemotePlayTogetherGuestInvite = 5703,
}
internal static partial class CallbackTypeFactory
{
Expand All @@ -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 )},
Expand Down Expand Up @@ -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 )},
Expand Down Expand Up @@ -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 )},
Expand Down Expand Up @@ -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 )},
};
}
}
12 changes: 6 additions & 6 deletions Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
47 changes: 41 additions & 6 deletions Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )]
Expand Down Expand Up @@ -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 );
Expand Down
23 changes: 17 additions & 6 deletions Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
75 changes: 62 additions & 13 deletions Facepunch.Steamworks/Generated/SteamCallbacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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) );
Expand Down Expand Up @@ -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) );
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down
Loading