// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.Friends { public sealed partial class FriendsInterface : Handle { public FriendsInterface() { } public FriendsInterface(System.IntPtr innerHandle) : base(innerHandle) { } /// /// The most recent version of the API. /// public const int AcceptinviteApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyfriendsupdateApiLatest = 1; /// /// The most recent version of the API. /// public const int GetfriendatindexApiLatest = 1; /// /// The most recent version of the API. /// public const int GetfriendscountApiLatest = 1; /// /// The most recent version of the API. /// public const int GetstatusApiLatest = 1; /// /// The most recent version of the API. /// public const int QueryfriendsApiLatest = 1; /// /// The most recent version of the API. /// public const int RejectinviteApiLatest = 1; /// /// The most recent version of the API. /// public const int SendinviteApiLatest = 1; /// /// Starts an asynchronous task that accepts a friend invitation from another user. The completion delegate is executed after the backend response has been received. /// /// structure containing the logged in account and the inviting account /// arbitrary data that is passed back to you in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error public void AcceptInvite(AcceptInviteOptions options, object clientData, OnAcceptInviteCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAcceptInviteCallbackInternal(OnAcceptInviteCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Friends_AcceptInvite(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } /// /// Listen for changes to friends for a particular account. /// /// Information about who would like notifications. /// This value is returned to the caller when FriendsUpdateHandler is invoked. /// The callback to be invoked when a change to any friend status changes. /// /// A valid notification ID if successfully bound, or otherwise /// public ulong AddNotifyFriendsUpdate(AddNotifyFriendsUpdateOptions options, object clientData, OnFriendsUpdateCallback friendsUpdateHandler) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var friendsUpdateHandlerInternal = new OnFriendsUpdateCallbackInternal(OnFriendsUpdateCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, friendsUpdateHandler, friendsUpdateHandlerInternal); var funcResult = Bindings.EOS_Friends_AddNotifyFriendsUpdate(InnerHandle, optionsAddress, clientDataAddress, friendsUpdateHandlerInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Retrieves the Epic Online Services Account ID of an entry from the friends list that has already been retrieved by the API. /// The Epic Online Services Account ID returned by this function may belong to an account that has been invited to be a friend or that has invited the local user to be a friend. /// To determine if the Epic Online Services Account ID returned by this function is a friend or a pending friend invitation, use the function. /// /// /// /// structure containing the Epic Online Services Account ID of the owner of the friends list and the index into the list /// /// the Epic Online Services Account ID of the friend. Note that if the index provided is out of bounds, the returned Epic Online Services Account ID will be a "null" account ID. /// public EpicAccountId GetFriendAtIndex(GetFriendAtIndexOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_Friends_GetFriendAtIndex(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); EpicAccountId funcResultReturn; Helper.TryMarshalGet(funcResult, out funcResultReturn); return funcResultReturn; } /// /// Retrieves the number of friends on the friends list that has already been retrieved by the API. /// /// /// structure containing the Epic Online Services Account ID of user who owns the friends list /// /// the number of friends on the list /// public int GetFriendsCount(GetFriendsCountOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_Friends_GetFriendsCount(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Retrieve the friendship status between the local user and another user. /// /// /// structure containing the Epic Online Services Account ID of the friend list to check and the account of the user to test friendship status /// /// A value indicating whether the two accounts have a friendship, pending invites in either direction, or no relationship /// is returned for two users that have confirmed friendship /// is returned when the local user has sent a friend invitation but the other user has not accepted or rejected it /// is returned when the other user has sent a friend invitation to the local user /// is returned when there is no known relationship /// public FriendsStatus GetStatus(GetStatusOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_Friends_GetStatus(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Starts an asynchronous task that reads the user's friends list from the backend service, caching it for future use. /// /// @note When the Social Overlay is enabled then this will be called automatically. The Social Overlay is enabled by default (see ). /// /// structure containing the account for which to retrieve the friends list /// arbitrary data that is passed back to you in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error public void QueryFriends(QueryFriendsOptions options, object clientData, OnQueryFriendsCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnQueryFriendsCallbackInternal(OnQueryFriendsCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Friends_QueryFriends(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } /// /// Starts an asynchronous task that rejects a friend invitation from another user. The completion delegate is executed after the backend response has been received. /// /// structure containing the logged in account and the inviting account /// arbitrary data that is passed back to you in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error public void RejectInvite(RejectInviteOptions options, object clientData, OnRejectInviteCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnRejectInviteCallbackInternal(OnRejectInviteCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Friends_RejectInvite(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } /// /// Stop listening for friends changes on a previously bound handler. /// /// The previously bound notification ID. public void RemoveNotifyFriendsUpdate(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_Friends_RemoveNotifyFriendsUpdate(InnerHandle, notificationId); } /// /// Starts an asynchronous task that sends a friend invitation to another user. The completion delegate is executed after the backend response has been received. /// It does not indicate that the target user has responded to the friend invitation. /// /// structure containing the account to send the invite from and the account to send the invite to /// arbitrary data that is passed back to you in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error public void SendInvite(SendInviteOptions options, object clientData, OnSendInviteCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnSendInviteCallbackInternal(OnSendInviteCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Friends_SendInvite(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } [MonoPInvokeCallback(typeof(OnAcceptInviteCallbackInternal))] internal static void OnAcceptInviteCallbackInternalImplementation(System.IntPtr data) { OnAcceptInviteCallback callback; AcceptInviteCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnFriendsUpdateCallbackInternal))] internal static void OnFriendsUpdateCallbackInternalImplementation(System.IntPtr data) { OnFriendsUpdateCallback callback; OnFriendsUpdateInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnQueryFriendsCallbackInternal))] internal static void OnQueryFriendsCallbackInternalImplementation(System.IntPtr data) { OnQueryFriendsCallback callback; QueryFriendsCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnRejectInviteCallbackInternal))] internal static void OnRejectInviteCallbackInternalImplementation(System.IntPtr data) { OnRejectInviteCallback callback; RejectInviteCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnSendInviteCallbackInternal))] internal static void OnSendInviteCallbackInternalImplementation(System.IntPtr data) { OnSendInviteCallback callback; SendInviteCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } } }