목차 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Initialization and Status Change Event Processing
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h"
// Set the IdpCode for the login
EKGTIdpCode idpCode = EKGTIdpCode::Kakao;
// Log in with a specific IDP
FKGTPlayer::Login(idpCode, FKGTResultDelegate::CreateLambda([=](FKGTResult result)
{
if (result.IsSuccess())
{
// The current Player's ID issued by the platform
FString playerId = FKGTPlayer::GetCurrentPlayer().GetPlayerId();
// Platform access token
FString accessToken = FKGTPlayer::GetAccessToken();
// Retrieve the current IDP authentication information
FKGTIdpProfile idpProfile = FKGTPlayer::GetCurrentPlayer().GetIdpProfile();
// [TODO] Since the login was successful, proceed to the game screen.
}
else
{
// IDP login or platform login failed
// [TODO] If login fails, inform the user and prompt them to retry.
int32 resultCode = result.GetCode();
if (resultCode == FKGTResultCode::NetworkFailure || resultCode == FKGTResultCode::ServerTimeout || resultCode == FKGTResultCode::ServerConnectionFailed)
{
// [TODO] If a network error occurs, notify the user that the start failed due to a network issue and prompt to retry.
}
else if (resultCode == FKGTResultCode::Forbidden)
{
// [TODO] During the CBT period, authentication may not be possible for users who are not allowed. Provide an appropriate notification to the user.
}
else if (resultCode == FKGTResultCode::UserCanceled)
{
// [TODO] Since the user canceled during the login process, the login screen should be maintained.
}
else
{
// [TODO] If other errors occur, notify the user and prompt them to retry the login. It is necessary to check the error code and logs to determine the cause.
}
}
})); |
Logging In Through the Launcher
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 |
---|
#include "KakaoGameV4.h" // The bridgeToken received through the launcher FString bridgeToken = ""; FKGTPlayer::LoginWithBridgeToken(bridgeToken, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // The current Player's ID issued by the platform FString playerId = FKGTPlayer::GetCurrentPlayer().GetPlayerId(); // Platform access token FString accessToken = FKGTPlayer::GetAccessToken(); // Retrieve the current IDP authentication information FKGTIdpProfile idpProfile = FKGTPlayer::GetCurrentPlayer().GetIdpProfile(); // Additional information received through the launcher TSharedPtr<FJsonObject> bridgeTokenPayload = FKGTPlayer::GetCurrentPlayer().GetBridgeTokenPayload(); // [TODO] Log in to the game server and proceed to the game screen } else { // Handle login failure. // [TODO] 로그인 실패 시 사용자 안내 후 재 시도 하도록 하여야 합니다. int32 resultCode = result.GetCode(); if (resultCode == FKGTResultCode::NetworkFailure || resultCode == FKGTResultCode::ServerTimeout || resultCode == FKGTResultCode::ServerConnectionFailed) { // [TODO] If a network error occurs, prompt the user to retry logging in. } else if (resultCode == FKGTResultCode::Forbidden) { // [TODO] During the CBT period, authentication may not be possible for users who are not allowed. Display a notification to the user, and after clicking confirm, implement the app to exit. } else if (resultCode == FKGTResultCode::UserCanceled) { // [TODO] Since the user canceled during the login process, the login screen should be maintained. } else { // [TODO] If other errors occur, provide an error notification and prompt the user to retry logging in. // It is necessary to check the error code and logs to determine the cause. } } })); |
로그아웃
Logout
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...