PO/Library/Artifacts/f4/f47c514408fa78aad81c3df73aa...

280 lines
12 KiB
Plaintext
Raw Normal View History

2022-01-12 10:06:03 +03:00
<0F>.<2E>2019.4.19f1<00><><EFBFBD><EFBFBD> <00><>f<EFBFBD><66>!<21>5<>9<EFBFBD>4Q<0E><>B<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> E<00> <00><00>#<00>.<00>,<00>5a<00> <00><00>#<00>.<00>,<00><00><00>r<00> <00><00># <00>.<00>,
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00><00><00>J<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>\<00><00><><EFBFBD><EFBFBD><EFBFBD><00>H<00>r<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>w<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#!<00>.<00>,"<00><00><><00><><EFBFBD><EFBFBD>#@1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$<00><00><00>%.<00>j<00>&<00><00><><00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD>+<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>,@<00><00><00>-Q<00>j<00>.y<00>
<00> /<00><00>#0<00>.<00>,1<00> <00><>2@<00><00><> 3@<00><00>#4<00>.<00>,5<00>H<00><><00><><EFBFBD><EFBFBD>6<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>7@<00><00><00>8Q<00>j<00>9H<00><><00><><EFBFBD><EFBFBD>:<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>;@<00><00><00><Q<00>j<00>=H<00><><00><><EFBFBD><EFBFBD>><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>?@<00><00><00>@Q<00>j<00>AMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>G<EFBFBD><47>܏Z56<35>:!@i<>J*<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00>E<00> <00><00><00>.<00><00>(a<00> <00><00><00>.<00><00><00><00>r<00> <00><00> <00>.<00>
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>=<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00><00>.<00><00>y<00>Q <00><00><00>.<00> <00><00><00>X!H<00>i<00><><EFBFBD><EFBFBD>"<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>#@<00><00><00>$Q<00>j<00>%H<00>u<00><><EFBFBD><EFBFBD>&<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>'@<00><00><00>(Q<00>j<00>)PPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespace\<00>y<EFBFBD>`<00><00>y<EFBFBD>SSOCredentialsDialog<6F>using UnityEngine;
using UnityEditor;
using PlasticGui;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Progress;
using Codice.CM.Common;
using Codice.Client.Common.Connection;
using Unity.PlasticSCM.Editor.Configuration.CloudEdition.Welcome;
using PlasticGui.Configuration.CloudEdition.Welcome;
using System.Collections.Generic;
using PlasticGui.WebApi.Responses;
using PlasticGui.Configuration.CloudEdition;
namespace Unity.PlasticSCM.Editor.Configuration
{
internal class SSOCredentialsDialog : PlasticDialog, OAuthSignIn.INotify, Login.INotify
{
protected override Rect DefaultRect
{
get
{
var baseRect = base.DefaultRect;
return new Rect(baseRect.x, baseRect.y, 525, 450);
}
}
internal static AskCredentialsToUser.DialogData RequestCredentials(
string cloudServer,
EditorWindow parentWindow)
{
SSOCredentialsDialog dialog = Create(
cloudServer, new ProgressControlsForDialogs());
ResponseType dialogResult = dialog.RunModal(parentWindow);
return dialog.BuildCredentialsDialogData(dialogResult);
}
protected override void OnModalGUI()
{
Title(PlasticLocalization.GetString(
PlasticLocalization.Name.CredentialsDialogTitle));
Paragraph(PlasticLocalization.GetString(
PlasticLocalization.Name.CredentialsDialogExplanation, mServer));
GUILayout.Space(20);
DoEntriesArea();
GUILayout.Space(10);
DrawProgressForDialogs.For(
mProgressControls.ProgressData);
GUILayout.Space(10);
DoButtonsArea();
}
protected override string GetTitle()
{
return PlasticLocalization.GetString(
PlasticLocalization.Name.CredentialsDialogTitle);
}
AskCredentialsToUser.DialogData BuildCredentialsDialogData(
ResponseType dialogResult)
{
return new AskCredentialsToUser.DialogData(
dialogResult == ResponseType.Ok,
mEmail, mPassword, false, SEIDWorkingMode.SSOWorkingMode);
}
void OAuthSignIn.INotify.SuccessForSSO(string organization)
{
OkButtonAction();
}
void OAuthSignIn.INotify.SuccessForProfile(string email)
{
OkButtonAction();
}
void OAuthSignIn.INotify.SuccessForCredentials(
string email,
string accessToken)
{
OkButtonAction();
}
void OAuthSignIn.INotify.Cancel(string errorMessage)
{
CancelButtonAction();
}
void OAuthSignIn.INotify.SuccessForConfigure(
List<string> organizations,
bool canCreateAnOrganization,
string userName,
string accessToken)
{
mEmail = userName;
mPassword = accessToken;
if (!organizations.Contains(mServer))
{
CancelButtonAction();
return;
}
CloudEditionWelcomeWindow.JoinOrganization(mServer, userName, accessToken);
GetWindow<PlasticWindow>().InitializePlastic();
OkButtonAction();
}
void DoButtonsArea()
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
if (Application.platform == RuntimePlatform.WindowsEditor)
{
DoOkButton();
DoCancelButton();
return;
}
DoCancelButton();
DoOkButton();
}
}
internal void OAuthSignInForConfigure(string ssoProviderName)
{
OAuthSignIn mSignIn = new OAuthSignIn();
mSignIn.ForConfigure(
GetWindow<PlasticWindow>().PlasticWebRestApiForTesting,
ssoProviderName,
mProgressControls,
this,
GetWindow<PlasticWindow>().CmConnectionForTesting);
}
void DoUnityIDButton()
{
if (NormalButton("Sign in with Unity ID"))
{
OAuthSignInForConfigure(SsoProvider.UNITY_URL_ACTION);
}
}
void DoEntriesArea()
{
Paragraph("Sign in with Unity ID");
GUILayout.Space(5);
DoUnityIDButton();
GUILayout.Space(25);
Paragraph(" --or-- ");
Paragraph("Sign in with email");
mEmail = TextEntry(PlasticLocalization.GetString(
PlasticLocalization.Name.Email), mEmail,
ENTRY_WIDTH, ENTRY_X);
GUILayout.Space(5);
mPassword = PasswordEntry(PlasticLocalization.GetString(
PlasticLocalization.Name.Password), mPassword,
ENTRY_WIDTH, ENTRY_X);
}
void DoOkButton()
{
if (!AcceptButton(PlasticLocalization.GetString(
PlasticLocalization.Name.OkButton)))
return;
OkButtonWithValidationAction();
}
void DoCancelButton()
{
if (!NormalButton(PlasticLocalization.GetString(
PlasticLocalization.Name.CancelButton)))
return;
CancelButtonAction();
}
void OkButtonWithValidationAction()
{
Login.Run(
GetWindow<PlasticWindow>().PlasticWebRestApiForTesting,
new SaveCloudEditionCreds(),
mEmail,
mPassword,
string.Empty,
Login.Mode.Configure,
mProgressControls,
this);
}
void Login.INotify.SuccessForConfigure(
List<string> organizations,
bool canCreateAnOrganization)
{
OkButtonAction();
}
void Login.INotify.SuccessForSSO(
string organization)
{
OkButtonAction();
}
void Login.INotify.SuccessForCredentials(string userName, string password)
{
OkButtonAction();
}
void Login.INotify.SuccessForProfile(
string userName)
{
OkButtonAction();
}
void Login.INotify.ValidationFailed(
Login.ValidationResult validationResult)
{
CancelButtonAction();
}
void Login.INotify.SignUpNeeded(
Login.Data loginData)
{
CancelButtonAction();
}
void Login.INotify.Error(
string message)
{
CancelButtonAction();
}
static SSOCredentialsDialog Create(
string server,
ProgressControlsForDialogs progressControls)
{
var instance = CreateInstance<SSOCredentialsDialog>();
instance.mServer = server;
instance.mProgressControls = progressControls;
instance.mEnterKeyAction = instance.OkButtonWithValidationAction;
instance.mEscapeKeyAction = instance.CancelButtonAction;
return instance;
}
string mEmail;
string mPassword = string.Empty;
ProgressControlsForDialogs mProgressControls;
string mServer;
const float ENTRY_WIDTH = 345f;
const float ENTRY_X = 150f;
}
}SSOCredentialsDialog%Unity.PlasticSCM.Editor.Configuration