HIVE SDK for C++

Typedefs | Functions | Variables
AuthV4Helper

Provides advanced features of HIVE Authentication. More...

Typedefs

typedef std::function< void(ResultAPI const &result, std::shared_ptr< PlayerInfo > playerInfo)> AuthV4::Helper::onAuthV4Helper
 AuthV4Helper API request result callback. More...
 

Functions

static void AuthV4::Helper::syncAccount (ProviderType providerType, onAuthV4Helper listener)
 Helps to inform whether accounts conflict or not when executing the provided as well as other APIs. More...
 
static void AuthV4::Helper::signIn (onAuthV4Helper listener)
 Player sign-in
More...
 
static void AuthV4::Helper::signOut (onAuthV4Helper listener)
 Player sign-out
More...
 
static void AuthV4::Helper::playerDelete (onAuthV4Helper listener)
 사용자 삭제
More...
 
static void AuthV4::Helper::connect (ProviderType providerType, onAuthV4Helper listener)
 Provider Connection
More...
 
static void AuthV4::Helper::disconnect (ProviderType providerType, onAuthV4Helper listener)
 Provider disconnetion
More...
 
static void AuthV4::Helper::showAchievements (onAuthV4Helper listener)
 Queries Achievements
More...
 
static void AuthV4::Helper::showLeaderboard (onAuthV4Helper listener)
 Queries leaderboard
More...
 
static void AuthV4::Helper::achievementsReveal (const std::string achievementId, onAuthV4Helper listener)
 Reveal hidden achievement. More...
 
static void AuthV4::Helper::achievementsUnlock (const std::string achievementId, onAuthV4Helper listener)
 Unlock achievement. More...
 
static void AuthV4::Helper::achievementsIncrement (const std::string achievementId, const int value, onAuthV4Helper listener)
 Increases achievement figures. More...
 
static void AuthV4::Helper::leaderboardsSubmitScore (const std::string leaderboardId, const long long score, onAuthV4Helper listener)
 It update the leaderboard score. More...
 
static void AuthV4::Helper::showConflict (onAuthV4Helper listener)
 Displays conflict status, and HIVE UI avilable to select an account. More...
 
static void AuthV4::Helper::showConflict (ConflictSingleViewInfo const &viewInfo, onAuthV4Helper listener)
 Displays conflict status, and HIVE UI which is available to select an account as well as shows game information. More...
 
static void AuthV4::Helper::switchAccount (onAuthV4Helper listener)
 If accounts conflict, sign out the current player
and try to sign in with the account signed in on the user device. More...
 
static void AuthV4::Helper::resolveConflict (onAuthV4Helper listener)
 In case it is not changed the currently signed-in account after accounts conflict. More...
 
static std::vector< ProviderTypeAuthV4::Helper::getIDPList ()
 Receives the Provider lists sent by SDK. More...
 
static void AuthV4::Helper::showGameCenterLoginCancelDialog (onAuthV4DialogDismiss listener)
 If a sign-in window of Game Center is not displayed, show its status
and display a UI to inform how to sign in the Game Center. More...
 
 ConflictSingleViewInfo::ConflictSingleViewInfo (hive::PlayerID playerId)
 생성자 More...
 
 ConflictViewInfo::ConflictViewInfo (hive::PlayerID currentPlayerId, hive::PlayerID conflictPlayerId)
 생성자 More...
 
static std::string ProviderInfo::stringProviderType (hive::ProviderType providerType)
 Provider type으로 string 값을 얻어온다. More...
 
static hive::ProviderType ProviderInfo::providerTypeFromString (const std::string typeString)
 Provider string값으로 type을 얻어온다. More...
 

Variables

hive::PlayerID ProfileInfo::playerId
 사용자 Player ID
 
std::string PlayerInfo::playerToken
 사용자 Player 세션 토큰.
 
std::string PlayerInfo::did
 사용자 device identifier.
 
hive::ProviderType ProviderInfo::providerType
 Provider의 type.
 
std::string ProviderInfo::providerUserId
 < Provider의 이름. More...
 
std::string ProviderInfo::providerEmail
 Provider의 사용자 email (optional)
 
std::string AuthV4MaintenanceInfo::title
 Title.
 
std::string AuthV4MaintenanceInfo::message
 Contents.
 
std::string AuthV4MaintenanceInfo::button
 Text on the button ex) OK.
 
hive::AuthV4MaintenanceActionType AuthV4MaintenanceInfo::action
 Actions to be taken when the button is pressed.
 
std::string AuthV4MaintenanceInfo::url
 URL to be browsed when action is OPEN_URL.
 
std::string AuthV4MaintenanceInfo::startDate
 start time YYYY-mm-dd HH:ii
 
std::string AuthV4MaintenanceInfo::endDate
 end time YYYY-mm-dd HH:ii
 
int AuthV4MaintenanceInfo::remainingTime
 When action is EXIT, the time in seconds remaining until the maintenance completes. The time is updated in real time, and the app will be closed at 0 seconds.
 

Detailed Description

Provides advanced features of HIVE Authentication.



The detailed functions provided by this class are as follows.

Typedef Documentation

◆ onAuthV4Helper

typedef std::function<void(ResultAPI const & result,std::shared_ptr<PlayerInfo> playerInfo)> AuthV4::Helper::onAuthV4Helper

AuthV4Helper API request result callback.

Parameters
resultErrorCodes and Codes available for result values are as follows.
ErrorCode Code Description
SUCCESS Success Completed the request without account conflicts
NEED_INITIALIZE AuthV4NotInitialized Not initialized the HIVE SDK
INVALID_SESSION AuthV4SigninFirst Called the APIs required sign-in before sign-in
INVALID_PARAM AuthV4AlreadyAuthorized Called sign-in API again after sign-in
CONFLICT_PLAYER AuthV4ConflictPlayer The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed
PLAYER_CHANGE AuthV4PlayerChange Succeeded to change the player after accounts conflict
CANCELED AuthV4PlayerResolved Not changed the currently signed-in account after accounts conflict
INVALID_SESSION AuthV4HelperImplifiedLoginFail Required Explicit Login due to failure of Implicit Login
IN_PROGRESS AuthV4InProgressSignIn
AuthV4InProgressConnect
AuthV4InProgressShowLeaderboard
AuthV4InProgressShowAchievements
The request is still in progress
playerInfoPlayer information depending on results are as follows.
ErrorCode Code Player Info
SUCCESS Success The information of signed-in player
CONFLICT_PLAYER AuthV4ConflictPlayer The information of conflicted player
PLAYER_CHANGE AuthV4PlayerChange The information of the player who successfully changed its account
CANCELED AuthV4PlayerResolved The information of current player
See also
HIVEResultAPI, HIVEPlayerInfo

Function Documentation

◆ achievementsIncrement()

static void AuthV4::Helper::achievementsIncrement ( const std::string  achievementId,
const int  value,
onAuthV4Helper  listener 
)
static

Increases achievement figures.


Achievement figures is added as much as value set by the API call, not by setting.
If the total sum is Max, the achievement is automatically accomplished.

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Reference

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request achievementsIncrement
-
RESPONSE_FAIL AuthV4GoogleResponseFailAchievementsIncrement Failed to request achievementsIncrement -
Parameters
incrementalAchievementIdachievements's key value
valuevalue
listeneronAuthV4Helper achievementsIncrement result callback

◆ achievementsReveal()

static void AuthV4::Helper::achievementsReveal ( const std::string  achievementId,
onAuthV4Helper  listener 
)
static

Reveal hidden achievement.

Achievements are only revealed at 0%, not achieved.

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Reference

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request achievementsReveal
-
RESPONSE_FAIL AuthV4GoogleResponseFailAchievementsReveal Failed to request achievementsReveal -
Parameters
achievementIdachievements's key value
listeneronAuthV4Helper achievementsReveal result callback

◆ achievementsUnlock()

static void AuthV4::Helper::achievementsUnlock ( const std::string  achievementId,
onAuthV4Helper  listener 
)
static

Unlock achievement.

Whether hidden or open, achievement is achieved at 100%.

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Reference

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request achievementsUnlock
-
RESPONSE_FAIL AuthV4GoogleResponseFailAchievementsUnlock Failed to request achievementsUnlock -
Parameters
achievementIdachievements's key value
listeneronAuthV4Helper achievementsUnlock result callback

◆ ConflictSingleViewInfo()

ConflictSingleViewInfo::ConflictSingleViewInfo ( hive::PlayerID  playerId)

생성자

Parameters
playerId충돌된 사용자의 플레이어 아이디

◆ ConflictViewInfo()

ConflictViewInfo::ConflictViewInfo ( hive::PlayerID  currentPlayerId,
hive::PlayerID  conflictPlayerId 
)

생성자

Parameters
currentPlayerId현재 사용자의 플레이어 아이디
conflictPlayerId충돌된 사용자의 플레이어 아이디

◆ connect()

static void AuthV4::Helper::connect ( ProviderType  providerType,
onAuthV4Helper  listener 
)
static

Provider Connection

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to conenct with Provider
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
CANCELED AuthV4AppleLoginCancel If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center
CONFLICT_PLAYER AuthV4ConflictPlayer the player ID of the Provider to be connected already existed
playerInfo: The information of conflicted account
Follow the resolution in accordance with the type of account conflicts
Parameters
listeneronAuthV4Helper AuthV4Helper Connect result callback

◆ disconnect()

static void AuthV4::Helper::disconnect ( ProviderType  providerType,
onAuthV4Helper  listener 
)
static

Provider disconnetion

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to discconect with Provider
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
INVALID_PARAM AuthV4ProviderAlreadtDisconnected The Provider requested to disconnect was not connected with the account -
Parameters
listeneronAuthV4Helper AuthV4Helper Disconnect result callback

◆ getIDPList()

static std::vector< ProviderType > AuthV4::Helper::getIDPList ( )
static

Receives the Provider lists sent by SDK.



◆ leaderboardsSubmitScore()

static void AuthV4::Helper::leaderboardsSubmitScore ( const std::string  leaderboardId,
const long long  score,
onAuthV4Helper  listener 
)
static

It update the leaderboard score.


The score corresponding to the leaderboardId is updated with the score value.

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Reference

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request LeaderboardsSubmitScore
-
RESPONSE_FAIL AuthV4GoogleResponseFailLeaderboardsSubmitScore Failed to request LeaderboardsSubmitScore -
Parameters
leaderboardIdleaderboard's key value
scoreLeaderboard score
listeneronAuthV4Helper LeaderboardsSubmitScore result callback

◆ playerDelete()

static void AuthV4::Helper::playerDelete ( onAuthV4Helper  listener)
static

사용자 삭제

\~korean

사용 조건

  1. HIVE SDK 초기화
  2. HIVE SignIn 완료

주요 결과 코드

ErrorCode Code Description Solution
SUCCESS Success 로그아웃 성공
-
NEED_INITIALIZED AuthV4NotInitialized HIVE SDK가 초기화되지 않은 경우 AuthV4.setup() API로 HIVE SDK 초기화
Parameters
listenerAuthV4HelperListener AuthV4Helper PlayerDelete 결과 통지

Player delete

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to sign out
-
NEED_INITIALIZED AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
Parameters
listenerAuthV4HelperListener AuthV4Helper PlayerDelete result callback

◆ providerTypeFromString()

static hive::ProviderType ProviderInfo::providerTypeFromString ( const std::string  typeString)
static

Provider string값으로 type을 얻어온다.

Parameters
typeStringProvider string.
Returns
Provider type. (ex. kHIVEProviderTypeHIVE)

◆ resolveConflict()

static void AuthV4::Helper::resolveConflict ( onAuthV4Helper  listener)
static

In case it is not changed the currently signed-in account after accounts conflict.


Key result code

ErrorCode Code Description
CANCELED AuthV4PlayerResolved Not changed the currently signed-in account after accounts conflict
Parameters
listeneronAuthV4Helper AuthV4Helper Resolve Conflict result callback

◆ showAchievements()

static void AuthV4::Helper::showAchievements ( onAuthV4Helper  listener)
static

Queries Achievements

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Reference

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request Acheivement
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
CANCELED AuthV4AppleLoginCancel If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center
CONFLICT_PLAYER AuthV4ConflictPlayer The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed
Follow the resolution in accordance with the type of account conflicts
Parameters
listeneronAuthV4Helper AuthV4Helper Show achievements result callback

◆ showConflict() [1/2]

static void AuthV4::Helper::showConflict ( ConflictSingleViewInfo const &  viewInfo,
onAuthV4Helper  listener 
)
static

Displays conflict status, and HIVE UI which is available to select an account as well as shows game information.


Key result code

ErrorCode Code Description
PLAYER_CHANGE AuthV4PlayerChange Succeeded to change the player after accounts conflict
CANCELED AuthV4PlayerResolved Not changed the currently signed-in account after accounts conflict
INVALID_PARAM AuthV4InvalidConflictInfo Requested to resolve account conflicts not happened
Parameters
conflictDataConflictSingleViewInfo Game information of the account-conflicted player
listeneronAuthV4Helper AuthV4Helper Show Conflict result callback
See also
HIVEConflictSingleViewInfo

◆ showConflict() [2/2]

static void AuthV4::Helper::showConflict ( onAuthV4Helper  listener)
static

Displays conflict status, and HIVE UI avilable to select an account.

Key result code

ErrorCode Code Description
PLAYER_CHANGE AuthV4PlayerChange Succeeded to change the player after accounts conflict
CANCELED AuthV4PlayerResolved Not changed the currently signed-in account after accounts conflict
INVALID_PARAM AuthV4InvalidConflictInfo Requested to resolve account conflicts not happened
Parameters
listeneronAuthV4Helper AuthV4Helper Show Conflict result callback

◆ showGameCenterLoginCancelDialog()

static void AuthV4::Helper::showGameCenterLoginCancelDialog ( onAuthV4DialogDismiss  listener)
static

If a sign-in window of Game Center is not displayed, show its status
and display a UI to inform how to sign in the Game Center.

Parameters
listeneronAuthV4DialogDismiss callback whether account notification popup is closed or not
See also
onAuthV4DialogDismiss

◆ showLeaderboard()

static void AuthV4::Helper::showLeaderboard ( onAuthV4Helper  listener)
static

Queries leaderboard

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Refernce

  1. It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to request leaderboards
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
CANCELED AuthV4AppleLoginCancel If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center
CONFLICT_PLAYER AuthV4ConflictPlayer The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed
Follow the resolution in accordance with the type of account conflicts
Parameters
listeneronAuthV4Helper AuthV4Helper Show leaderboard result callback

◆ signIn()

static void AuthV4::Helper::signIn ( onAuthV4Helper  listener)
static

Player sign-in

Condition of use

  1. Complete to initialize HIVE SDK

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to sign in
playerInfo: The information of signed-in player
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
IN_PROGRESS AuthV4InProgressSignIn
Requested to process SignIn while sign-in is in progress Wait for the SignIn request in progress
CONFLICT_PLAYER AuthV4ConflictPlayer The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed
playerInfo: The information of conflicted account
Follow the resolution in accordance with the type of account conflicts
INVALID_SESSION AuthV4HelperImplifiedLoginFail Required Explicit Login due to failure of Implicit Login Query the supported Provider lists by calling AuthV4.Helper.getIDPList() and implement Explicit Login UI,
or implement Explicit Login by calling AuthV4.showSignIn() of HIVE UI
Parameters
listeneronAuthV4Helper AuthV4Helper Sign In result callback

◆ signOut()

static void AuthV4::Helper::signOut ( onAuthV4Helper  listener)
static

Player sign-out

Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Key result code

ErrorCode Code Description Solution
SUCCESS Success Succeeded to sign out
-
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
Parameters
listeneronAuthV4Helper AuthV4Helper Sign Out result callback

◆ stringProviderType()

static std::string ProviderInfo::stringProviderType ( hive::ProviderType  providerType)
static

Provider type으로 string 값을 얻어온다.

Parameters
providerTypeProvider Type.
Returns
Provier string. (ex. HIVE)

◆ switchAccount()

static void AuthV4::Helper::switchAccount ( onAuthV4Helper  listener)
static

If accounts conflict, sign out the current player
and try to sign in with the account signed in on the user device.


Key result code

ErrorCode Code Description
PLAYER_CHANGE AuthV4PlayerChange Succeeded to change the player after accounts conflict
Parameters
listeneronAuthV4Helper AuthV4Helper Switch Account result callback

◆ syncAccount()

static void AuthV4::Helper::syncAccount ( ProviderType  providerType,
onAuthV4Helper  listener 
)
static

Helps to inform whether accounts conflict or not when executing the provided as well as other APIs.


Condition of use

  1. Complete to initialize HIVE SDK
  2. Complete HIVE SignIn

Key result code

ErrorCode Code Description Solution
SUCCESS Success Account normal state -
NEED_INITIALIZE AuthV4NotInitialized HIVE SDK not initialized Initialize HIVE SDK by implementing AuthV4.setup() API
CONFLICT_PLAYER AuthV4ConflictPlayer Mismatched the signed-in account with PGS/GameCenter account on the device Follow the resolution in accordance with the type of account conflicts
NOT_SUPPORTED AuthV4NotSupportedProviderType Queried account state with other provider types except PGS/GameCenter -
Parameters
providerTypeProviderType to request syncronization
listeneronAuthV4Helper AuthV4Helper Sync Account result callback

Variable Documentation

◆ providerUserId

std::string ProviderInfo::providerUserId

< Provider의 이름.

Provider의 사용자 user identifier.

Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy