using BackEnd;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
using UnityEngine.UI;
public class NewBehaviourScript : MonoBehaviour
{
public Text logText;
void Start()
{
Login();
}
public void Login()
{
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
void ProcessAuthentication(SignInStatus status)
{
if (status == SignInStatus.Success)
{
GetAccessCode();
// Continue with Play Games Services
}
else
{
// Disable your integration with Play Games Services or show a login button
// to ask users to sign-in. Clicking it should call
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
logText.text = "뒤끝 로그인 실패 ";
}
}
public void GetAccessCode()
{
PlayGamesPlatform.Instance.RequestServerSideAccess(
/* forceRefreshToken= */ false,
code => {
Debug.Log("구글 인증 코드 : " + code);
Backend.BMember.GetGPGS2AccessToken(code, googleCallback =>
{
Debug.Log("GetGPGS2AccessToken 함수 호출 결과 " + googleCallback);
string accessToken = "";
if (googleCallback.IsSuccess())
{
accessToken = googleCallback.GetReturnValuetoJSON()["access_token"].ToString();
Debug.Log(accessToken);
var bro = Backend.BMember.AuthorizeFederation(
accessToken,
FederationType.GPGS2,
"GPGS2로 가입함"
);
Debug.Log("bro.GetStatusCode()" +bro.GetStatusCode());
Debug.Log("bro.GetErrorCode()" + bro.GetErrorCode());
Debug.Log("bro.GetMessage()" + bro.GetMessage());
}
});
});
}
}
이 코드로 했을떄
2024-03-14 07:09:04.568 12521 12758 Info Unity
2024-03-14 07:09:04.588 12521 12766 Info Unity ya29.a0Ad52N3-NJhmz3fnjZ-CF_6DQBt77LEUNIhrNKLQwd8TXiF6iXEQwsG55-_6cKI41xSLypKTjEZwqurSrv4yGd6Dcw4WFPceBv7HYPoC9TpTRiMCS_XD2bZdRvZLG6vwMx9W4R2-7_lqD2rvR4RTJIt2_tprKaBDoEQaCgYKAYcSARISFQHGX2Mi5Kt6plMq12ejkFlZvUrTzA0169
2024-03-14 07:09:04.588 12521 12766 Info Unity <>c:b__4_1(BackendReturnObject)
2024-03-14 07:09:04.588 12521 12766 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:04.588 12521 12766 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:04.588 12521 12766 Info Unity
2024-03-14 07:09:16.328 12521 12758 Info Unity bro.GetStatusCode()401
2024-03-14 07:09:16.328 12521 12758 Info Unity <>c:b__4_1(BackendReturnObject)
2024-03-14 07:09:16.328 12521 12758 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.328 12521 12758 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.328 12521 12758 Info Unity
2024-03-14 07:09:16.344 12521 12766 Info Unity bro.GetStatusCode()500
2024-03-14 07:09:16.344 12521 12766 Info Unity <>c:b__4_1(BackendReturnObject)
2024-03-14 07:09:16.344 12521 12766 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.344 12521 12766 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.344 12521 12766 Info Unity
2024-03-14 07:09:16.349 12521 12766 Info Unity bro.GetErrorCode()ERR_INVALID_ARG_TYPE
2024-03-14 07:09:16.349 12521 12766 Info Unity <>c:b__4_1(BackendReturnObject)
2024-03-14 07:09:16.349 12521 12766 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.349 12521 12766 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.349 12521 12766 Info Unity
2024-03-14 07:09:16.356 12521 12758 Info Unity bro.GetErrorCode()BadUnauthorizedException
2024-03-14 07:09:16.356 12521 12758 Info Unity <>c:b__4_1(BackendReturnObject)
2024-03-14 07:09:16.356 12521 12758 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.356 12521 12758 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.356 12521 12758 Info Unity
2024-03-14 07:09:16.358 12521 12766 Info Unity bro.GetMessage()The “key” argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received undefined
2024-03-14 07:09:16.358 12521 12766 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.358 12521 12766 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.358 12521 12766 Info Unity
2024-03-14 07:09:16.375 12521 12758 Info Unity bro.GetMessage()bad packageName, 잘못된 packageName 입니다
2024-03-14 07:09:16.375 12521 12758 Info Unity BackEnd.Game.d__96:MoveNext()
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction(Action, Boolean, Task&)
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.Tasks.Task:FinishContinuations()
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.Tasks.Task:Finish(Boolean)
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.Tasks.Task:ExecuteEntry(Boolean)
2024-03-14 07:09:16.375 12521 12758 Info Unity System.Threading.ThreadPoolWorkQueue:Dispatch()
2024-03-14 07:09:16.375 12521 12758 Info Unity
이렇게 나와요
해결 어떻게 해야되나요?