diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs new file mode 100644 index 0000000..e424e1d --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -0,0 +1,172 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamParties : SteamInterface + { + public ISteamParties( bool server = false ) : base( server ) + { + } + + public override string InterfaceName => "SteamParties002"; + + public override void InitInternals() + { + _GetNumActiveBeacons = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 0) ); + _GetBeaconByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 8) ); + _GetBeaconDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 16) ); + _JoinParty = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 24) ); + _GetNumAvailableBeaconLocations = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 32) ); + _GetAvailableBeaconLocations = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 40) ); + _CreateBeacon = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 48) ); + _OnReservationCompleted = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 56) ); + _CancelReservation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 64) ); + _ChangeNumOpenSlots = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 72) ); + _DestroyBeacon = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 80) ); + _GetBeaconLocationData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 88) ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate uint FGetNumActiveBeacons( IntPtr self ); + private FGetNumActiveBeacons _GetNumActiveBeacons; + + #endregion + internal uint GetNumActiveBeacons() + { + return _GetNumActiveBeacons( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate PartyBeaconID_t FGetBeaconByIndex( IntPtr self, uint unIndex ); + private FGetBeaconByIndex _GetBeaconByIndex; + + #endregion + internal PartyBeaconID_t GetBeaconByIndex( uint unIndex ) + { + return _GetBeaconByIndex( Self, unIndex ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetBeaconDetails( IntPtr self, PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, StringBuilder pchMetadata, int cchMetadata ); + private FGetBeaconDetails _GetBeaconDetails; + + #endregion + internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, StringBuilder pchMetadata, int cchMetadata ) + { + return _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, pchMetadata, cchMetadata ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate SteamAPICall_t FJoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); + private FJoinParty _JoinParty; + + #endregion + internal async Task JoinParty( PartyBeaconID_t ulBeaconID ) + { + return await JoinPartyCallback_t.GetResultAsync( _JoinParty( Self, ulBeaconID ) ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetNumAvailableBeaconLocations( IntPtr self, ref uint puNumLocations ); + private FGetNumAvailableBeaconLocations _GetNumAvailableBeaconLocations; + + #endregion + internal bool GetNumAvailableBeaconLocations( ref uint puNumLocations ) + { + return _GetNumAvailableBeaconLocations( Self, ref puNumLocations ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAvailableBeaconLocations( IntPtr self, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ); + private FGetAvailableBeaconLocations _GetAvailableBeaconLocations; + + #endregion + internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ) + { + return _GetAvailableBeaconLocations( Self, ref pLocationList, uMaxNumLocations ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate SteamAPICall_t FCreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata ); + private FCreateBeacon _CreateBeacon; + + #endregion + internal async Task CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata ) + { + return await CreateBeaconCallback_t.GetResultAsync( _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ) ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate void FOnReservationCompleted( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + private FOnReservationCompleted _OnReservationCompleted; + + #endregion + internal void OnReservationCompleted( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _OnReservationCompleted( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate void FCancelReservation( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + private FCancelReservation _CancelReservation; + + #endregion + internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _CancelReservation( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + private delegate SteamAPICall_t FChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); + private FChangeNumOpenSlots _ChangeNumOpenSlots; + + #endregion + internal async Task ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) + { + return await ChangeNumOpenSlotsCallback_t.GetResultAsync( _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ) ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDestroyBeacon( IntPtr self, PartyBeaconID_t ulBeacon ); + private FDestroyBeacon _DestroyBeacon; + + #endregion + internal bool DestroyBeacon( PartyBeaconID_t ulBeacon ) + { + return _DestroyBeacon( Self, ulBeacon ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetBeaconLocationData( IntPtr self, SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, StringBuilder pchDataStringOut, int cchDataStringOut ); + private FGetBeaconLocationData _GetBeaconLocationData; + + #endregion + internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, StringBuilder pchDataStringOut, int cchDataStringOut ) + { + return _GetBeaconLocationData( Self, BeaconLocation, eData, pchDataStringOut, cchDataStringOut ); + } + + } +} diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs index e392fd7..05a6799 100644 --- a/Generator/CodeWriter/ClassVTable.cs +++ b/Generator/CodeWriter/ClassVTable.cs @@ -153,6 +153,8 @@ private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function fun if ( returnType is SteamApiCallType sap ) { sap.CallResult = func.CallResult; + + argstr = string.Join( ", ", args.Select( x => x.AsArgument().Replace( "ref ", " /* ref */ " ) ) ); } WriteLine( $"#region FunctionMeta" ); diff --git a/Generator/CodeWriter/CodeWriter.cs b/Generator/CodeWriter/CodeWriter.cs index 0a8f599..a78199f 100644 --- a/Generator/CodeWriter/CodeWriter.cs +++ b/Generator/CodeWriter/CodeWriter.cs @@ -79,6 +79,7 @@ public void ToFolder( string folder ) GenerateVTableClass( "ISteamInventory", $"{folder}../Generated/Interfaces/ISteamInventory.cs" ); GenerateVTableClass( "ISteamNetworking", $"{folder}../Generated/Interfaces/ISteamNetworking.cs" ); GenerateVTableClass( "ISteamMatchmaking", $"{folder}../Generated/Interfaces/ISteamMatchmaking.cs" ); + GenerateVTableClass( "ISteamParties", $"{folder}../Generated/Interfaces/ISteamParties.cs" ); } }