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.
379 lines
17 KiB
379 lines
17 KiB
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
// This file is automatically generated. Changes to this file may be overwritten.
|
|
|
|
namespace Epic.OnlineServices.Presence
|
|
{
|
|
public sealed partial class PresenceInterface : Handle
|
|
{
|
|
public PresenceInterface()
|
|
{
|
|
}
|
|
|
|
public PresenceInterface(System.IntPtr innerHandle) : base(innerHandle)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// The most recent version of the <see cref="AddNotifyJoinGameAccepted" /> API.
|
|
/// </summary>
|
|
public const int AddnotifyjoingameacceptedApiLatest = 2;
|
|
|
|
public const int AddnotifyonpresencechangedApiLatest = 1;
|
|
|
|
public const int CopypresenceApiLatest = 3;
|
|
|
|
public const int CreatepresencemodificationApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// The maximum allowed length a data's key may be. This value is subject to change and data structures should be designed to allow for greater numbers than this.
|
|
/// </summary>
|
|
public const int DataMaxKeyLength = 64;
|
|
|
|
/// <summary>
|
|
/// The maximum of allowed individual pieces of data a user may have. This value is subject to change and data structures should be designed to allow for greater
|
|
/// numbers than this.
|
|
/// </summary>
|
|
public const int DataMaxKeys = 32;
|
|
|
|
/// <summary>
|
|
/// The maximum allowed length a data's value may be. This value is subject to change and data structures should be designed to allow for greater numbers than this.
|
|
/// </summary>
|
|
public const int DataMaxValueLength = 255;
|
|
|
|
public const int DatarecordApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// DEPRECATED! Use <see cref="PresenceModification.PresencemodificationDeletedataApiLatest" /> instead.
|
|
/// </summary>
|
|
public const int DeletedataApiLatest = PresenceModification.PresencemodificationDeletedataApiLatest;
|
|
|
|
public const int GetjoininfoApiLatest = 1;
|
|
|
|
public const int HaspresenceApiLatest = 1;
|
|
|
|
public const int InfoApiLatest = 3;
|
|
|
|
/// <summary>
|
|
/// The presence key used to specify the local platform's presence string on platforms that use tokenized presence.
|
|
/// For use with <see cref="PresenceModification.SetData" />.
|
|
/// <seealso cref="PresenceModification.SetData" />
|
|
/// <seealso cref="DataRecord" />
|
|
/// </summary>
|
|
public static readonly Utf8String KeyPlatformPresence = "EOS_PlatformPresence";
|
|
|
|
public const int QuerypresenceApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// The maximum allowed length a user's rich text string may be. This value is subject to change and data structures should be designed to allow for greater numbers
|
|
/// than this.
|
|
/// </summary>
|
|
public const int RichTextMaxValueLength = 255;
|
|
|
|
/// <summary>
|
|
/// DEPRECATED! Use <see cref="PresenceModification.PresencemodificationSetdataApiLatest" /> instead.
|
|
/// </summary>
|
|
public const int SetdataApiLatest = PresenceModification.PresencemodificationSetdataApiLatest;
|
|
|
|
public const int SetpresenceApiLatest = 1;
|
|
|
|
/// <summary>
|
|
/// DEPRECATED! Use <see cref="PresenceModification.PresencemodificationSetrawrichtextApiLatest" /> instead.
|
|
/// </summary>
|
|
public const int SetrawrichtextApiLatest = PresenceModification.PresencemodificationSetrawrichtextApiLatest;
|
|
|
|
/// <summary>
|
|
/// DEPRECATED! Use <see cref="PresenceModification.PresencemodificationSetstatusApiLatest" /> instead.
|
|
/// </summary>
|
|
public const int SetstatusApiLatest = PresenceModification.PresencemodificationSetstatusApiLatest;
|
|
|
|
/// <summary>
|
|
/// Register to receive notifications when a user accepts a join game option via the social overlay.
|
|
/// must call RemoveNotifyJoinGameAccepted to remove the notification
|
|
/// </summary>
|
|
/// <param name="options">Structure containing information about the request.</param>
|
|
/// <param name="clientData">Arbitrary data that is passed back to you in the CompletionDelegate.</param>
|
|
/// <param name="notificationFn">A callback that is fired when a a notification is received.</param>
|
|
/// <returns>
|
|
/// handle representing the registered callback
|
|
/// </returns>
|
|
public ulong AddNotifyJoinGameAccepted(ref AddNotifyJoinGameAcceptedOptions options, object clientData, OnJoinGameAcceptedCallback notificationFn)
|
|
{
|
|
AddNotifyJoinGameAcceptedOptionsInternal optionsInternal = new AddNotifyJoinGameAcceptedOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var clientDataAddress = System.IntPtr.Zero;
|
|
|
|
var notificationFnInternal = new OnJoinGameAcceptedCallbackInternal(OnJoinGameAcceptedCallbackInternalImplementation);
|
|
Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal);
|
|
|
|
var funcResult = Bindings.EOS_Presence_AddNotifyJoinGameAccepted(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register to receive notifications when presence changes. If the returned NotificationId is valid, you must call RemoveNotifyOnPresenceChanged when you no longer wish to
|
|
/// have your NotificationHandler called
|
|
/// <seealso cref="Common.InvalidNotificationid" />
|
|
/// <seealso cref="RemoveNotifyOnPresenceChanged" />
|
|
/// </summary>
|
|
/// <param name="clientData">Data the is returned to when NotificationHandler is invoked</param>
|
|
/// <param name="notificationHandler">The callback to be fired when a presence change occurs</param>
|
|
/// <returns>
|
|
/// Notification ID representing the registered callback if successful, an invalid NotificationId if not
|
|
/// </returns>
|
|
public ulong AddNotifyOnPresenceChanged(ref AddNotifyOnPresenceChangedOptions options, object clientData, OnPresenceChangedCallback notificationHandler)
|
|
{
|
|
AddNotifyOnPresenceChangedOptionsInternal optionsInternal = new AddNotifyOnPresenceChangedOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var clientDataAddress = System.IntPtr.Zero;
|
|
|
|
var notificationHandlerInternal = new OnPresenceChangedCallbackInternal(OnPresenceChangedCallbackInternalImplementation);
|
|
Helper.AddCallback(out clientDataAddress, clientData, notificationHandler, notificationHandlerInternal);
|
|
|
|
var funcResult = Bindings.EOS_Presence_AddNotifyOnPresenceChanged(InnerHandle, ref optionsInternal, clientDataAddress, notificationHandlerInternal);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get a user's cached presence object. If successful, this data must be released by calling <see cref="Release" />
|
|
/// <seealso cref="Release" />
|
|
/// </summary>
|
|
/// <param name="options">Object containing properties related to who is requesting presence and for what user</param>
|
|
/// <param name="outPresence">A pointer to a pointer of Presence Info. If the returned result is success, this will be set to data that must be later released, otherwise this will be set to <see langword="null" /></param>
|
|
/// <returns>
|
|
/// Success if we have cached data, or an error result if the request was invalid or we do not have cached data.
|
|
/// </returns>
|
|
public Result CopyPresence(ref CopyPresenceOptions options, out Info? outPresence)
|
|
{
|
|
CopyPresenceOptionsInternal optionsInternal = new CopyPresenceOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var outPresenceAddress = System.IntPtr.Zero;
|
|
|
|
var funcResult = Bindings.EOS_Presence_CopyPresence(InnerHandle, ref optionsInternal, ref outPresenceAddress);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
Helper.Get<InfoInternal, Info>(outPresenceAddress, out outPresence);
|
|
if (outPresence != null)
|
|
{
|
|
Bindings.EOS_Presence_Info_Release(outPresenceAddress);
|
|
}
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a presence modification handle. This handle can used to add multiple changes to your presence that can be applied with <see cref="SetPresence" />.
|
|
/// The resulting handle must be released by calling <see cref="PresenceModification.Release" /> once it has been passed to <see cref="SetPresence" />.
|
|
/// <seealso cref="PresenceModification.Release" />
|
|
/// <seealso cref="SetPresence" />
|
|
/// <seealso cref="PresenceModification.SetStatus" />
|
|
/// <seealso cref="PresenceModification.SetRawRichText" />
|
|
/// <seealso cref="PresenceModification.SetData" />
|
|
/// <seealso cref="PresenceModification.DeleteData" />
|
|
/// </summary>
|
|
/// <param name="options">Object containing properties related to the user modifying their presence</param>
|
|
/// <param name="outPresenceModificationHandle">Pointer to a Presence Modification Handle to be set if successful</param>
|
|
/// <returns>
|
|
/// Success if we successfully created the Presence Modification Handle pointed at in OutPresenceModificationHandle, or an error result if the input data was invalid
|
|
/// </returns>
|
|
public Result CreatePresenceModification(ref CreatePresenceModificationOptions options, out PresenceModification outPresenceModificationHandle)
|
|
{
|
|
CreatePresenceModificationOptionsInternal optionsInternal = new CreatePresenceModificationOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var outPresenceModificationHandleAddress = System.IntPtr.Zero;
|
|
|
|
var funcResult = Bindings.EOS_Presence_CreatePresenceModification(InnerHandle, ref optionsInternal, ref outPresenceModificationHandleAddress);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
Helper.Get(outPresenceModificationHandleAddress, out outPresenceModificationHandle);
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets a join info custom game-data string for a specific user. This is a helper function for reading the presence data related to how a user can be joined.
|
|
/// Its meaning is entirely application dependent.
|
|
///
|
|
/// This value will be valid only after a QueryPresence call has successfully completed.
|
|
/// <seealso cref="PresenceModification.PresencemodificationJoininfoMaxLength" />
|
|
/// </summary>
|
|
/// <param name="options">Object containing an associated user</param>
|
|
/// <param name="outBuffer">The buffer into which the character data should be written. The buffer must be long enough to hold a string of <see cref="PresenceModification.PresencemodificationJoininfoMaxLength" />.</param>
|
|
/// <param name="inOutBufferLength">
|
|
/// Used as an input to define the OutBuffer length.
|
|
/// The input buffer should include enough space to be null-terminated.
|
|
/// When the function returns, this parameter will be filled with the length of the string copied into OutBuffer.
|
|
/// </param>
|
|
/// <returns>
|
|
/// An <see cref="Result" /> that indicates whether the location string was copied into the OutBuffer.
|
|
/// <see cref="Result.Success" /> if the information is available and passed out in OutBuffer
|
|
/// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
|
|
/// <see cref="Result.NotFound" /> if there is user or the location string was not found.
|
|
/// <see cref="Result.LimitExceeded" /> - The OutBuffer is not large enough to receive the location string. InOutBufferLength contains the required minimum length to perform the operation successfully.
|
|
/// </returns>
|
|
public Result GetJoinInfo(ref GetJoinInfoOptions options, out Utf8String outBuffer)
|
|
{
|
|
GetJoinInfoOptionsInternal optionsInternal = new GetJoinInfoOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
int inOutBufferLength = PresenceModification.PresencemodificationJoininfoMaxLength + 1;
|
|
System.IntPtr outBufferAddress = Helper.AddAllocation(inOutBufferLength);
|
|
|
|
var funcResult = Bindings.EOS_Presence_GetJoinInfo(InnerHandle, ref optionsInternal, outBufferAddress, ref inOutBufferLength);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
Helper.Get(outBufferAddress, out outBuffer);
|
|
Helper.Dispose(ref outBufferAddress);
|
|
|
|
return funcResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Check if we already have presence for a user
|
|
/// </summary>
|
|
/// <param name="options">Object containing properties related to who is requesting presence and for what user</param>
|
|
/// <returns>
|
|
/// <see langword="true" /> if we have presence for the requested user, or <see langword="false" /> if the request was invalid or we do not have cached data
|
|
/// </returns>
|
|
public bool HasPresence(ref HasPresenceOptions options)
|
|
{
|
|
HasPresenceOptionsInternal optionsInternal = new HasPresenceOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var funcResult = Bindings.EOS_Presence_HasPresence(InnerHandle, ref optionsInternal);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
|
|
bool funcResultReturn;
|
|
Helper.Get(funcResult, out funcResultReturn);
|
|
return funcResultReturn;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Query a user's presence. This must complete successfully before CopyPresence will have valid results. If HasPresence returns true for a remote
|
|
/// user, this does not need to be called.
|
|
/// </summary>
|
|
/// <param name="options">Object containing properties related to who is querying presence and for what user</param>
|
|
/// <param name="clientData">Optional pointer to help track this request, that is returned in the completion callback</param>
|
|
/// <param name="completionDelegate">Pointer to a function that handles receiving the completion information</param>
|
|
public void QueryPresence(ref QueryPresenceOptions options, object clientData, OnQueryPresenceCompleteCallback completionDelegate)
|
|
{
|
|
QueryPresenceOptionsInternal optionsInternal = new QueryPresenceOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var clientDataAddress = System.IntPtr.Zero;
|
|
|
|
var completionDelegateInternal = new OnQueryPresenceCompleteCallbackInternal(OnQueryPresenceCompleteCallbackInternalImplementation);
|
|
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
|
|
|
|
Bindings.EOS_Presence_QueryPresence(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Unregister from receiving notifications when a user accepts a join game option via the social overlay.
|
|
/// </summary>
|
|
/// <param name="inId">Handle representing the registered callback</param>
|
|
public void RemoveNotifyJoinGameAccepted(ulong inId)
|
|
{
|
|
Bindings.EOS_Presence_RemoveNotifyJoinGameAccepted(InnerHandle, inId);
|
|
|
|
Helper.RemoveCallbackByNotificationId(inId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Unregister a previously bound notification handler from receiving presence update notifications
|
|
/// </summary>
|
|
/// <param name="notificationId">The Notification ID representing the registered callback</param>
|
|
public void RemoveNotifyOnPresenceChanged(ulong notificationId)
|
|
{
|
|
Bindings.EOS_Presence_RemoveNotifyOnPresenceChanged(InnerHandle, notificationId);
|
|
|
|
Helper.RemoveCallbackByNotificationId(notificationId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets your new presence with the data applied to a PresenceModificationHandle. The PresenceModificationHandle can be released safely after calling this function.
|
|
/// <seealso cref="CreatePresenceModification" />
|
|
/// <seealso cref="PresenceModification.Release" />
|
|
/// </summary>
|
|
/// <param name="options">Object containing a PresenceModificationHandle and associated user data</param>
|
|
/// <param name="clientData">Optional pointer to help track this request, that is returned in the completion callback</param>
|
|
/// <param name="completionDelegate">Pointer to a function that handles receiving the completion information</param>
|
|
public void SetPresence(ref SetPresenceOptions options, object clientData, SetPresenceCompleteCallback completionDelegate)
|
|
{
|
|
SetPresenceOptionsInternal optionsInternal = new SetPresenceOptionsInternal();
|
|
optionsInternal.Set(ref options);
|
|
|
|
var clientDataAddress = System.IntPtr.Zero;
|
|
|
|
var completionDelegateInternal = new SetPresenceCompleteCallbackInternal(SetPresenceCompleteCallbackInternalImplementation);
|
|
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
|
|
|
|
Bindings.EOS_Presence_SetPresence(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
|
|
|
|
Helper.Dispose(ref optionsInternal);
|
|
}
|
|
|
|
[MonoPInvokeCallback(typeof(OnJoinGameAcceptedCallbackInternal))]
|
|
internal static void OnJoinGameAcceptedCallbackInternalImplementation(ref JoinGameAcceptedCallbackInfoInternal data)
|
|
{
|
|
OnJoinGameAcceptedCallback callback;
|
|
JoinGameAcceptedCallbackInfo callbackInfo;
|
|
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
|
|
{
|
|
callback(ref callbackInfo);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallback(typeof(OnPresenceChangedCallbackInternal))]
|
|
internal static void OnPresenceChangedCallbackInternalImplementation(ref PresenceChangedCallbackInfoInternal data)
|
|
{
|
|
OnPresenceChangedCallback callback;
|
|
PresenceChangedCallbackInfo callbackInfo;
|
|
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
|
|
{
|
|
callback(ref callbackInfo);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallback(typeof(OnQueryPresenceCompleteCallbackInternal))]
|
|
internal static void OnQueryPresenceCompleteCallbackInternalImplementation(ref QueryPresenceCallbackInfoInternal data)
|
|
{
|
|
OnQueryPresenceCompleteCallback callback;
|
|
QueryPresenceCallbackInfo callbackInfo;
|
|
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
|
|
{
|
|
callback(ref callbackInfo);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallback(typeof(SetPresenceCompleteCallbackInternal))]
|
|
internal static void SetPresenceCompleteCallbackInternalImplementation(ref SetPresenceCallbackInfoInternal data)
|
|
{
|
|
SetPresenceCompleteCallback callback;
|
|
SetPresenceCallbackInfo callbackInfo;
|
|
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
|
|
{
|
|
callback(ref callbackInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|