Hi, I’m using the latest version of eos_plugin_for_unity (4.0.2) in Unity 2022.3.60f1 on Windows and I’m struggling to get a login setup that allows me to unlock EOS Achievements.
I’m currently doing the following (simplified code below).
From what I’ve seen in the samples this should be correct, right? Do I need to login with the connect interface or can I do it some way with the auth interface only? Also, is it required to handle auth expiration?
private void BeginLogin() {
var args = EOSManager.EOSSingleton.GetCommandLineArgsFromEpicLauncher();
var credentialType = LoginCredentialType.ExchangeCode;
if (string.IsNullOrEmpty(args.epicUserID) || string.IsNullOrEmpty(args.authPassword)) {
credentialType = EOS_AUTH.LoginCredentialType.AccountPortal;
}
EOSManager.Instance.StartLoginWithLoginTypeAndToken(credentialType, args.epicUserID, args.authPassword, StartLoginCallback);
}
private void StartLoginCallback(LoginCallbackInfo info) {
if (info.ResultCode == Result.Success) {
EOSManager.Instance.StartConnectLoginWithEpicAccount(info.LocalUserId, ConnectCallback);
}
}
private void ConnectCallback(LoginCallbackInfo info) {
if (connectLoginResult.ResultCode != Result.Success) {
EOSManager.Instance.CreateConnectUserWithContinuanceToken(info.ContinuanceToken, CreateConnectUserCallback);
}
}
private void CreateConnectUserCallback(CreateUserCallbackInfo info) {
if (info.ResultCode != Result.Success) {
var localUserId = EOSManager.Instance.GetLocalUserId();
EOSManager.Instance.StartConnectLoginWithEpicAccount(localUserId, NewUserConnectCallback);
}
}
private void NewUserConnectCallback(LoginCallbackInfo info) {
if (info.ResultCode == Result.Success) {
_loggedIn = true;
}
}