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.

123 lines
4.9 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(ref ActiveSessionCopyInfoOptions options, out ActiveSessionInfo? outActiveSessionInfo)
{
ActiveSessionCopyInfoOptionsInternal optionsInternal = new ActiveSessionCopyInfoOptionsInternal();
optionsInternal.Set(ref options);
var outActiveSessionInfoAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_ActiveSession_CopyInfo(InnerHandle, ref optionsInternal, ref outActiveSessionInfoAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get<ActiveSessionInfoInternal, ActiveSessionInfo>(outActiveSessionInfoAddress, out outActiveSessionInfo);
if (outActiveSessionInfo != null)
{
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(ref ActiveSessionGetRegisteredPlayerByIndexOptions options)
{
ActiveSessionGetRegisteredPlayerByIndexOptionsInternal optionsInternal = new ActiveSessionGetRegisteredPlayerByIndexOptionsInternal();
optionsInternal.Set(ref options);
var funcResult = Bindings.EOS_ActiveSession_GetRegisteredPlayerByIndex(InnerHandle, ref optionsInternal);
Helper.Dispose(ref optionsInternal);
ProductUserId funcResultReturn;
Helper.Get(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(ref ActiveSessionGetRegisteredPlayerCountOptions options)
{
ActiveSessionGetRegisteredPlayerCountOptionsInternal optionsInternal = new ActiveSessionGetRegisteredPlayerCountOptionsInternal();
optionsInternal.Set(ref options);
var funcResult = Bindings.EOS_ActiveSession_GetRegisteredPlayerCount(InnerHandle, ref optionsInternal);
Helper.Dispose(ref optionsInternal);
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);
}
}
}