You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
5.0 KiB
122 lines
5.0 KiB
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
// This file is automatically generated. Changes to this file may be overwritten.
|
|
|
|
namespace Epic.OnlineServices.Sessions
|
|
{
|
|
public sealed partial class ActiveSession : Handle
|
|
{
|
|
public ActiveSession()
|
|
{
|
|
}
|
|
|
|
public ActiveSession(System.IntPtr innerHandle) : base(innerHandle)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// The most recent version of the <see cref="CopyInfo" /> function.
|
|
/// </summary>
|
|
public const int ActivesessionCopyinfoApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// The most recent version of the <see cref="GetRegisteredPlayerByIndex" /> function.
|
|
/// </summary>
|
|
public const int ActivesessionGetregisteredplayerbyindexApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// The most recent version of the <see cref="GetRegisteredPlayerCount" /> function.
|
|
/// </summary>
|
|
public const int ActivesessionGetregisteredplayercountApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// The most recent version of the <see cref="ActiveSessionInfo" /> struct.
|
|
/// </summary>
|
|
public const int ActivesessionInfoApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// <see cref="CopyInfo" /> is used to immediately retrieve a copy of active session information
|
|
/// If the call returns an <see cref="Result.Success" /> result, the out parameter, OutActiveSessionInfo, must be passed to <see cref="Release" /> to release the memory associated with it.
|
|
/// <seealso cref="ActiveSessionInfo" />
|
|
/// <seealso cref="ActiveSessionCopyInfoOptions" />
|
|
/// <seealso cref="Release" />
|
|
/// </summary>
|
|
/// <param name="options">Structure containing the input parameters</param>
|
|
/// <param name="outActiveSessionInfo">Out parameter used to receive the <see cref="ActiveSessionInfo" /> structure.</param>
|
|
/// <returns>
|
|
/// <see cref="Result.Success" /> if the information is available and passed out in OutActiveSessionInfo
|
|
/// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
|
|
/// <see cref="Result.IncompatibleVersion" /> if the API version passed in is incorrect
|
|
/// </returns>
|
|
public Result CopyInfo(ActiveSessionCopyInfoOptions options, out ActiveSessionInfo outActiveSessionInfo)
|
|
{
|
|
var optionsAddress = System.IntPtr.Zero;
|
|
Helper.TryMarshalSet<ActiveSessionCopyInfoOptionsInternal, ActiveSessionCopyInfoOptions>(ref optionsAddress, options);
|
|
|
|
var outActiveSessionInfoAddress = System.IntPtr.Zero;
|
|
|
|
var funcResult = Bindings.EOS_ActiveSession_CopyInfo(InnerHandle, optionsAddress, ref outActiveSessionInfoAddress);
|
|
|
|
Helper.TryMarshalDispose(ref optionsAddress);
|
|
|
|
if (Helper.TryMarshalGet<ActiveSessionInfoInternal, ActiveSessionInfo>(outActiveSessionInfoAddress, out outActiveSessionInfo))
|
|
{
|
|
Bindings.EOS_ActiveSession_Info_Release(outActiveSessionInfoAddress);
|
|
}
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <see cref="GetRegisteredPlayerByIndex" /> is used to immediately retrieve individual players registered with the active session.
|
|
/// <seealso cref="GetRegisteredPlayerCount" />
|
|
/// <seealso cref="ActiveSessionGetRegisteredPlayerByIndexOptions" />
|
|
/// </summary>
|
|
/// <param name="options">Structure containing the input parameters</param>
|
|
/// <returns>
|
|
/// the product user ID for the registered player at a given index or null if that index is invalid
|
|
/// </returns>
|
|
public ProductUserId GetRegisteredPlayerByIndex(ActiveSessionGetRegisteredPlayerByIndexOptions options)
|
|
{
|
|
var optionsAddress = System.IntPtr.Zero;
|
|
Helper.TryMarshalSet<ActiveSessionGetRegisteredPlayerByIndexOptionsInternal, ActiveSessionGetRegisteredPlayerByIndexOptions>(ref optionsAddress, options);
|
|
|
|
var funcResult = Bindings.EOS_ActiveSession_GetRegisteredPlayerByIndex(InnerHandle, optionsAddress);
|
|
|
|
Helper.TryMarshalDispose(ref optionsAddress);
|
|
|
|
ProductUserId funcResultReturn;
|
|
Helper.TryMarshalGet(funcResult, out funcResultReturn);
|
|
return funcResultReturn;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the number of registered players associated with this active session
|
|
/// </summary>
|
|
/// <param name="options">the Options associated with retrieving the registered player count</param>
|
|
/// <returns>
|
|
/// number of registered players in the active session or 0 if there is an error
|
|
/// </returns>
|
|
public uint GetRegisteredPlayerCount(ActiveSessionGetRegisteredPlayerCountOptions options)
|
|
{
|
|
var optionsAddress = System.IntPtr.Zero;
|
|
Helper.TryMarshalSet<ActiveSessionGetRegisteredPlayerCountOptionsInternal, ActiveSessionGetRegisteredPlayerCountOptions>(ref optionsAddress, options);
|
|
|
|
var funcResult = Bindings.EOS_ActiveSession_GetRegisteredPlayerCount(InnerHandle, optionsAddress);
|
|
|
|
Helper.TryMarshalDispose(ref optionsAddress);
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Release the memory associated with an active session.
|
|
/// This must be called on data retrieved from <see cref="SessionsInterface.CopyActiveSessionHandle" />
|
|
/// <seealso cref="SessionsInterface.CopyActiveSessionHandle" />
|
|
/// </summary>
|
|
/// <param name="activeSessionHandle">- The active session handle to release</param>
|
|
public void Release()
|
|
{
|
|
Bindings.EOS_ActiveSession_Release(InnerHandle);
|
|
}
|
|
}
|
|
}
|