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.

126 lines
5.4 KiB

// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Sanctions
{
public sealed partial class SanctionsInterface : Handle
{
public SanctionsInterface()
{
}
public SanctionsInterface(System.IntPtr innerHandle) : base(innerHandle)
{
}
/// <summary>
/// The most recent version of the <see cref="CopyPlayerSanctionByIndex" /> API.
/// </summary>
public const int CopyplayersanctionbyindexApiLatest = 1;
/// <summary>
/// The most recent version of the <see cref="GetPlayerSanctionCount" /> API.
/// </summary>
public const int GetplayersanctioncountApiLatest = 1;
/// <summary>
/// The most recent version of the <see cref="PlayerSanction" /> struct.
/// </summary>
public const int PlayersanctionApiLatest = 1;
/// <summary>
/// The most recent version of the <see cref="QueryActivePlayerSanctions" /> API.
/// </summary>
public const int QueryactiveplayersanctionsApiLatest = 2;
/// <summary>
/// Copies an active player sanction.
/// You must call QueryActivePlayerSanctions first to retrieve the data from the service backend.
/// On success, <see cref="Release" /> must be called on OutSanction to free memory.
/// <seealso cref="QueryActivePlayerSanctions" />
/// <seealso cref="Release" />
/// </summary>
/// <param name="options">Structure containing the input parameters</param>
/// <param name="outSanction">The player sanction data for the given index, if it exists and is valid</param>
/// <returns>
/// <see cref="Result.Success" /> if the information is available and passed out in OutSanction
/// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
/// <see cref="Result.NotFound" /> if the player achievement is not found
/// </returns>
public Result CopyPlayerSanctionByIndex(CopyPlayerSanctionByIndexOptions options, out PlayerSanction outSanction)
{
var optionsAddress = System.IntPtr.Zero;
Helper.TryMarshalSet<CopyPlayerSanctionByIndexOptionsInternal, CopyPlayerSanctionByIndexOptions>(ref optionsAddress, options);
var outSanctionAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Sanctions_CopyPlayerSanctionByIndex(InnerHandle, optionsAddress, ref outSanctionAddress);
Helper.TryMarshalDispose(ref optionsAddress);
if (Helper.TryMarshalGet<PlayerSanctionInternal, PlayerSanction>(outSanctionAddress, out outSanction))
{
Bindings.EOS_Sanctions_PlayerSanction_Release(outSanctionAddress);
}
return funcResult;
}
/// <summary>
/// Fetch the number of player sanctions that have been retrieved for a given player.
/// You must call QueryActivePlayerSanctions first to retrieve the data from the service backend.
/// <seealso cref="QueryActivePlayerSanctions" />
/// <seealso cref="CopyPlayerSanctionByIndex" />
/// </summary>
/// <param name="options">Structure containing the input parameters</param>
/// <returns>
/// Number of available sanctions for this player.
/// </returns>
public uint GetPlayerSanctionCount(GetPlayerSanctionCountOptions options)
{
var optionsAddress = System.IntPtr.Zero;
Helper.TryMarshalSet<GetPlayerSanctionCountOptionsInternal, GetPlayerSanctionCountOptions>(ref optionsAddress, options);
var funcResult = Bindings.EOS_Sanctions_GetPlayerSanctionCount(InnerHandle, optionsAddress);
Helper.TryMarshalDispose(ref optionsAddress);
return funcResult;
}
/// <summary>
/// Start an asynchronous query to retrieve any active sanctions for a specified user.
/// Call <see cref="GetPlayerSanctionCount" /> and <see cref="CopyPlayerSanctionByIndex" /> to retrieve the data.
/// <seealso cref="GetPlayerSanctionCount" />
/// <seealso cref="CopyPlayerSanctionByIndex" />
/// </summary>
/// <param name="options">Structure containing the input parameters</param>
/// <param name="clientData">Arbitrary data that is passed back to you in the CompletionDelegate</param>
/// <param name="completionDelegate">A callback that is fired when the async operation completes, either successfully or in error</param>
public void QueryActivePlayerSanctions(QueryActivePlayerSanctionsOptions options, object clientData, OnQueryActivePlayerSanctionsCallback completionDelegate)
{
var optionsAddress = System.IntPtr.Zero;
Helper.TryMarshalSet<QueryActivePlayerSanctionsOptionsInternal, QueryActivePlayerSanctionsOptions>(ref optionsAddress, options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnQueryActivePlayerSanctionsCallbackInternal(OnQueryActivePlayerSanctionsCallbackInternalImplementation);
Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Sanctions_QueryActivePlayerSanctions(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);
Helper.TryMarshalDispose(ref optionsAddress);
}
[MonoPInvokeCallback(typeof(OnQueryActivePlayerSanctionsCallbackInternal))]
internal static void OnQueryActivePlayerSanctionsCallbackInternalImplementation(System.IntPtr data)
{
OnQueryActivePlayerSanctionsCallback callback;
QueryActivePlayerSanctionsCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback<OnQueryActivePlayerSanctionsCallback, QueryActivePlayerSanctionsCallbackInfoInternal, QueryActivePlayerSanctionsCallbackInfo>(data, out callback, out callbackInfo))
{
callback(callbackInfo);
}
}
}
}