Skip to content

Commit

Permalink
Add SteamTimeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohansi committed Dec 16, 2024
1 parent 5783d89 commit e445525
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 29 deletions.
32 changes: 16 additions & 16 deletions Facepunch.Steamworks/Generated/Interfaces/ISteamTimeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,73 +53,73 @@ internal void SetTimelineGameMode( TimelineGameMode eMode )

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent", CallingConvention = Platform.CC)]
private static extern TimelineEventHandle_t _AddInstantaneousTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
private static extern TimelineEventHandle _AddInstantaneousTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );

#endregion
internal TimelineEventHandle_t AddInstantaneousTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
internal TimelineEventHandle AddInstantaneousTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
{
var returnValue = _AddInstantaneousTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip );
return returnValue;
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddRangeTimelineEvent", CallingConvention = Platform.CC)]
private static extern TimelineEventHandle_t _AddRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip );
private static extern TimelineEventHandle _AddRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip );

#endregion
internal TimelineEventHandle_t AddRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip )
internal TimelineEventHandle AddRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip )
{
var returnValue = _AddRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip );
return returnValue;
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_StartRangeTimelineEvent", CallingConvention = Platform.CC)]
private static extern TimelineEventHandle_t _StartRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
private static extern TimelineEventHandle _StartRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );

#endregion
internal TimelineEventHandle_t StartRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
internal TimelineEventHandle StartRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
{
var returnValue = _StartRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unPriority, flStartOffsetSeconds, ePossibleClip );
return returnValue;
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent", CallingConvention = Platform.CC)]
private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip );
private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip );

#endregion
internal void UpdateRangeTimelineEvent( TimelineEventHandle_t ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip )
internal void UpdateRangeTimelineEvent( TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip )
{
_UpdateRangeTimelineEvent( Self, ulEvent, pchTitle, pchDescription, pchIcon, unPriority, ePossibleClip );
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_EndRangeTimelineEvent", CallingConvention = Platform.CC)]
private static extern void _EndRangeTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent, float flEndOffsetSeconds );
private static extern void _EndRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, float flEndOffsetSeconds );

#endregion
internal void EndRangeTimelineEvent( TimelineEventHandle_t ulEvent, float flEndOffsetSeconds )
internal void EndRangeTimelineEvent( TimelineEventHandle ulEvent, float flEndOffsetSeconds )
{
_EndRangeTimelineEvent( Self, ulEvent, flEndOffsetSeconds );
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_RemoveTimelineEvent", CallingConvention = Platform.CC)]
private static extern void _RemoveTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent );
private static extern void _RemoveTimelineEvent( IntPtr self, TimelineEventHandle ulEvent );

#endregion
internal void RemoveTimelineEvent( TimelineEventHandle_t ulEvent )
internal void RemoveTimelineEvent( TimelineEventHandle ulEvent )
{
_RemoveTimelineEvent( Self, ulEvent );
}

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_DoesEventRecordingExist", CallingConvention = Platform.CC)]
private static extern SteamAPICall_t _DoesEventRecordingExist( IntPtr self, TimelineEventHandle_t ulEvent );
private static extern SteamAPICall_t _DoesEventRecordingExist( IntPtr self, TimelineEventHandle ulEvent );

#endregion
internal CallResult<SteamTimelineEventRecordingExists_t> DoesEventRecordingExist( TimelineEventHandle_t ulEvent )
internal CallResult<SteamTimelineEventRecordingExists_t> DoesEventRecordingExist( TimelineEventHandle ulEvent )
{
var returnValue = _DoesEventRecordingExist( Self, ulEvent );
return new CallResult<SteamTimelineEventRecordingExists_t>( returnValue, IsServer );
Expand Down Expand Up @@ -198,10 +198,10 @@ internal void OpenOverlayToGamePhase( [MarshalAs( UnmanagedType.CustomMarshaler,

#region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent", CallingConvention = Platform.CC)]
private static extern void _OpenOverlayToTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent );
private static extern void _OpenOverlayToTimelineEvent( IntPtr self, TimelineEventHandle ulEvent );

#endregion
internal void OpenOverlayToTimelineEvent( TimelineEventHandle_t ulEvent )
internal void OpenOverlayToTimelineEvent( TimelineEventHandle ulEvent )
{
_OpenOverlayToTimelineEvent( Self, ulEvent );
}
Expand Down
4 changes: 2 additions & 2 deletions Facepunch.Steamworks/Generated/SteamEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ internal enum SteamItemFlags : int
//
// ETimelineGameMode
//
internal enum TimelineGameMode : int
public enum TimelineGameMode : int
{
Invalid = 0,
Playing = 1,
Expand All @@ -2209,7 +2209,7 @@ internal enum TimelineGameMode : int
//
// ETimelineEventClipPriority
//
internal enum TimelineEventClipPriority : int
public enum TimelineEventClipPriority : int
{
Invalid = 0,
None = 1,
Expand Down
16 changes: 8 additions & 8 deletions Facepunch.Steamworks/Generated/SteamTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,20 +598,20 @@ internal struct SteamInventoryUpdateHandle_t : IEquatable<SteamInventoryUpdateHa
public int CompareTo( SteamInventoryUpdateHandle_t other ) => Value.CompareTo( other.Value );
}

internal struct TimelineEventHandle_t : IEquatable<TimelineEventHandle_t>, IComparable<TimelineEventHandle_t>
public struct TimelineEventHandle : IEquatable<TimelineEventHandle>, IComparable<TimelineEventHandle>
{
// Name: TimelineEventHandle_t, Type: unsigned long long
public ulong Value;

public static implicit operator TimelineEventHandle_t( ulong value ) => new TimelineEventHandle_t(){ Value = value };
public static implicit operator ulong( TimelineEventHandle_t value ) => value.Value;
public static implicit operator TimelineEventHandle( ulong value ) => new TimelineEventHandle(){ Value = value };
public static implicit operator ulong( TimelineEventHandle value ) => value.Value;
public override string ToString() => Value.ToString();
public override int GetHashCode() => Value.GetHashCode();
public override bool Equals( object p ) => this.Equals( (TimelineEventHandle_t) p );
public bool Equals( TimelineEventHandle_t p ) => p.Value == Value;
public static bool operator ==( TimelineEventHandle_t a, TimelineEventHandle_t b ) => a.Equals( b );
public static bool operator !=( TimelineEventHandle_t a, TimelineEventHandle_t b ) => !a.Equals( b );
public int CompareTo( TimelineEventHandle_t other ) => Value.CompareTo( other.Value );
public override bool Equals( object p ) => this.Equals( (TimelineEventHandle) p );
public bool Equals( TimelineEventHandle p ) => p.Value == Value;
public static bool operator ==( TimelineEventHandle a, TimelineEventHandle b ) => a.Equals( b );
public static bool operator !=( TimelineEventHandle a, TimelineEventHandle b ) => !a.Equals( b );
public int CompareTo( TimelineEventHandle other ) => Value.CompareTo( other.Value );
}

internal struct RemotePlaySessionID_t : IEquatable<RemotePlaySessionID_t>, IComparable<RemotePlaySessionID_t>
Expand Down
9 changes: 6 additions & 3 deletions Facepunch.Steamworks/SteamClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static void Init( uint appid, bool asyncCallbacks = true )
ISteamUserStats.Version,
ISteamUtils.Version,
ISteamVideo.Version,
ISteamRemotePlay.Version );
ISteamRemotePlay.Version,
ISteamTimeline.Version );
var result = SteamAPI.Init( interfaceVersions, out var error );
if ( result != SteamAPIInitResult.OK )
{
Expand All @@ -55,12 +56,12 @@ public static void Init( uint appid, bool asyncCallbacks = true )
initialized = true;

//
// Dispatch is responsible for pumping the
// event loop.
// Dispatch is responsible for pumping the event loop.
//
Dispatch.Init();
Dispatch.ClientPipe = SteamAPI.GetHSteamPipe();

// Note: don't forget to add the interface version to SteamAPI.Init above!!!
AddInterface<SteamApps>();
AddInterface<SteamFriends>();
AddInterface<SteamInput>();
Expand All @@ -81,6 +82,8 @@ public static void Init( uint appid, bool asyncCallbacks = true )
AddInterface<SteamUtils>();
AddInterface<SteamVideo>();
AddInterface<SteamRemotePlay>();
AddInterface<SteamTimeline>();
// Note: don't forget to add the interface version to SteamAPI.Init above!!!

initialized = openInterfaces.Count > 0;

Expand Down
Loading

0 comments on commit e445525

Please sign in to comment.