// 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 SessionSearch : Handle { public SessionSearch() { } public SessionSearch(System.IntPtr innerHandle) : base(innerHandle) { } /// /// The most recent version of the API. /// public const int SessionsearchCopysearchresultbyindexApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchFindApiLatest = 2; /// /// The most recent version of the API. /// public const int SessionsearchGetsearchresultcountApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchRemoveparameterApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchSetmaxsearchresultsApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchSetparameterApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchSetsessionidApiLatest = 1; /// /// The most recent version of the API. /// public const int SessionsearchSettargetuseridApiLatest = 1; /// /// is used to immediately retrieve a handle to the session information from a given search result. /// If the call returns an result, the out parameter, OutSessionHandle, must be passed to to release the memory associated with it. /// /// /// /// Structure containing the input parameters /// out parameter used to receive the session handle /// /// if the information is available and passed out in OutSessionHandle /// if you pass an invalid index or a null pointer for the out parameter /// if the API version passed in is incorrect /// public Result CopySearchResultByIndex(SessionSearchCopySearchResultByIndexOptions options, out SessionDetails outSessionHandle) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var outSessionHandleAddress = System.IntPtr.Zero; var funcResult = Bindings.EOS_SessionSearch_CopySearchResultByIndex(InnerHandle, optionsAddress, ref outSessionHandleAddress); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outSessionHandleAddress, out outSessionHandle); return funcResult; } /// /// Find sessions matching the search criteria setup via this session search handle. /// When the operation completes, this handle will have the search results that can be parsed /// /// Structure containing information about the search criteria to use /// Arbitrary data that is passed back to you in the CompletionDelegate /// A callback that is fired when the search operation completes, either successfully or in error /// /// if the find operation completes successfully /// if searching for an individual session by sessionid or targetuserid returns no results /// if any of the options are incorrect /// public void Find(SessionSearchFindOptions options, object clientData, SessionSearchOnFindCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new SessionSearchOnFindCallbackInternal(OnFindCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_SessionSearch_Find(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } /// /// Get the number of search results found by the search parameters in this search /// /// Options associated with the search count /// /// return the number of search results found by the query or 0 if search is not complete /// public uint GetSearchResultCount(SessionSearchGetSearchResultCountOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_GetSearchResultCount(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Release the memory associated with a session search. This must be called on data retrieved from . /// /// /// - The session search handle to release public void Release() { Bindings.EOS_SessionSearch_Release(InnerHandle); } /// /// Remove a parameter from the array of search criteria. /// /// @params Options a search parameter key name to remove /// /// /// if removing this search parameter was successful /// if the search key is invalid or null /// if the parameter was not a part of the search criteria /// if the API version passed in is incorrect /// public Result RemoveParameter(SessionSearchRemoveParameterOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_RemoveParameter(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Set the maximum number of search results to return in the query, can't be more than /// /// maximum number of search results to return in the query /// /// if setting the max results was successful /// if the number of results requested is invalid /// if the API version passed in is incorrect /// public Result SetMaxResults(SessionSearchSetMaxResultsOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_SetMaxResults(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Add a parameter to an array of search criteria combined via an implicit AND operator. Setting SessionId or TargetUserId will result in failing /// /// /// /// a search parameter and its comparison op /// /// if setting this search parameter was successful /// if the search criteria is invalid or null /// if the API version passed in is incorrect /// public Result SetParameter(SessionSearchSetParameterOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_SetParameter(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Set a session ID to find and will return at most one search result. Setting TargetUserId or SearchParameters will result in failing /// /// A specific session ID for which to search /// /// if setting this session ID was successful /// if the session ID is invalid or null /// if the API version passed in is incorrect /// public Result SetSessionId(SessionSearchSetSessionIdOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_SetSessionId(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Set a target user ID to find and will return at most one search result. Setting SessionId or SearchParameters will result in failing /// @note a search result will only be found if this user is in a public session /// /// a specific target user ID to find /// /// if setting this target user ID was successful /// if the target user ID is invalid or null /// if the API version passed in is incorrect /// public Result SetTargetUserId(SessionSearchSetTargetUserIdOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_SessionSearch_SetTargetUserId(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } [MonoPInvokeCallback(typeof(SessionSearchOnFindCallbackInternal))] internal static void OnFindCallbackInternalImplementation(System.IntPtr data) { SessionSearchOnFindCallback callback; SessionSearchFindCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } } }