103 lines
4.7 KiB
C
103 lines
4.7 KiB
C
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "eos_auth_types.h"
|
|
|
|
/**
|
|
* The Auth Interface is used to manage local user permissions and access to backend services through the verification of various forms of credentials.
|
|
* All Auth Interface calls take a handle of type EOS_HAuth as the first parameter.
|
|
* This handle can be retrieved from a EOS_HPlatform handle by using the EOS_Platform_GetAuthInterface function.
|
|
*
|
|
* NOTE: At this time, this feature is only available for products that are part of the Epic Games store.
|
|
*
|
|
* @see EOS_Platform_GetAuthInterface
|
|
*/
|
|
|
|
/**
|
|
* Login/Authenticate with user credentials.
|
|
*
|
|
* @param Options structure containing the account credentials to use during the login operation
|
|
* @param ClientData arbitrary data that is passed back to you in the CompletionDelegate
|
|
* @param CompletionDelegate a callback that is fired when the login operation completes, either successfully or in error
|
|
*/
|
|
EOS_DECLARE_FUNC(void) EOS_Auth_Login(EOS_HAuth Handle, const EOS_Auth_LoginOptions* Options, void* ClientData, const EOS_Auth_OnLoginCallback CompletionDelegate);
|
|
|
|
/**
|
|
* Signs the player out of the online service.
|
|
*
|
|
* @param Options structure containing information about which account to log out.
|
|
* @param ClientData arbitrary data that is passed back to you in the CompletionDelegate
|
|
* @param CompletionDelegate a callback that is fired when the logout operation completes, either successfully or in error
|
|
*/
|
|
EOS_DECLARE_FUNC(void) EOS_Auth_Logout(EOS_HAuth Handle, const EOS_Auth_LogoutOptions* Options, void* ClientData, const EOS_Auth_OnLogoutCallback CompletionDelegate);
|
|
|
|
/**
|
|
* Contact the backend service to verify validity of an existing user auth token.
|
|
* This function is intended for server-side use only.
|
|
*
|
|
* @param Options structure containing information about the auth token being verified
|
|
* @param ClientData arbitrary data that is passed back to you in the CompletionDelegate
|
|
* @param CompletionDelegate a callback that is fired when the logout operation completes, either successfully or in error
|
|
*/
|
|
EOS_DECLARE_FUNC(void) EOS_Auth_VerifyUserAuth(EOS_HAuth Handle, const EOS_Auth_VerifyUserAuthOptions* Options, void* ClientData, const EOS_Auth_OnVerifyUserAuthCallback CompletionDelegate);
|
|
|
|
/**
|
|
* Fetch the number of accounts that are logged in.
|
|
*
|
|
* @return the number of accounts logged in.
|
|
*/
|
|
EOS_DECLARE_FUNC(int32_t) EOS_Auth_GetLoggedInAccountsCount(EOS_HAuth Handle);
|
|
|
|
/**
|
|
* Fetch an account id that is logged in.
|
|
*
|
|
* @param Index an index into the list of logged in accounts. If the index is out of bounds, the returned account id will be invalid.
|
|
*
|
|
* @return the account id associated with the index passed
|
|
*/
|
|
EOS_DECLARE_FUNC(EOS_EpicAccountId) EOS_Auth_GetLoggedInAccountByIndex(EOS_HAuth Handle, int32_t Index);
|
|
|
|
/**
|
|
* Fetches the login status for an account id.
|
|
*
|
|
* @param LocalUserId the account id of the user being queried
|
|
*
|
|
* @return the enum value of a user's login status
|
|
*/
|
|
EOS_DECLARE_FUNC(EOS_ELoginStatus) EOS_Auth_GetLoginStatus(EOS_HAuth Handle, EOS_EpicAccountId LocalUserId);
|
|
|
|
/**
|
|
* Fetches a user auth token for an account id.
|
|
*
|
|
* @param Options structure containing the api version of CopyUserAuthToken to use
|
|
* @param LocalUserId the account id of the user being queried
|
|
* @param OutUserAuthToken the auth token for the given user, if it exists and is valid, use EOS_Auth_Token_Release when finished
|
|
*
|
|
* @see EOS_Auth_Token_Release
|
|
*
|
|
* @return EOS_Success if the information is available and passed out in OutUserAuthToken
|
|
* EOS_InvalidParameters if you pass a null pointer for the out parameter
|
|
* EOS_NotFound if the auth token is not found or expired.
|
|
*
|
|
*/
|
|
EOS_DECLARE_FUNC(EOS_EResult) EOS_Auth_CopyUserAuthToken(EOS_HAuth Handle, const EOS_Auth_CopyUserAuthTokenOptions* Options, EOS_EpicAccountId LocalUserId, EOS_Auth_Token ** OutUserAuthToken);
|
|
|
|
/**
|
|
* Register to receive login status updates.
|
|
* @note must call RemoveNotifyLoginStatusChanged to remove the notification
|
|
*
|
|
* @param Options structure containing the api version of AddNotifyLoginStatusChanged to use
|
|
* @param ClientData arbitrary data that is passed back to you in the callback
|
|
* @param Notification a callback that is fired when the login status for a user changes
|
|
*
|
|
* @return handle representing the registered callback
|
|
*/
|
|
EOS_DECLARE_FUNC(EOS_NotificationId) EOS_Auth_AddNotifyLoginStatusChanged(EOS_HAuth Handle, const EOS_Auth_AddNotifyLoginStatusChangedOptions* Options, void* ClientData, const EOS_Auth_OnLoginStatusChangedCallback Notification);
|
|
|
|
/**
|
|
* Unregister from receiving login status updates.
|
|
*
|
|
* @param InId handle representing the registered callback
|
|
*/
|
|
EOS_DECLARE_FUNC(void) EOS_Auth_RemoveNotifyLoginStatusChanged(EOS_HAuth Handle, EOS_NotificationId InId);
|