public void Update(Profile profile, Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName, IEnumerable <Disney.Mix.SDK.Internal.GuestControllerDomain.MarketingItem> marketing) { UpdateDisplayName(displayName); UpdateProfile(profile); UpdateMarketing(marketing); LastRefreshTime = DateTime.UtcNow; }
public static bool StoreProfile(AbstractLogger logger, IDatabase database, IEpochTime epochTime, string swid, ProfileData profileData) { Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayNameData = profileData.displayName; if (displayNameData != null) { try { database.UpdateSessionDocument(swid, delegate(SessionDocument doc) { doc.DisplayNameText = displayNameData.displayName; doc.ProposedDisplayName = displayNameData.proposedDisplayName; doc.ProposedDisplayNameStatus = displayNameData.proposedStatus; doc.FirstName = profileData.profile.firstName; doc.LastProfileRefreshTime = epochTime.Seconds; doc.AccountStatus = profileData.profile.status; }); } catch (Exception arg) { logger.Critical("Unhandled exception: " + arg); return(false); } } return(true); }
private void UpdateDisplayName(Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName) { if (displayName != null) { if (!DateTime.TryParse(displayName.moderatedStatusDate, out var result)) { DisplayNameModeratedStatusDate = null; logger.Error("Received an invalid moderated status date: " + result); } else { DisplayNameModeratedStatusDate = result; } DisplayName = displayName.displayName; ProposedDisplayName = displayName.proposedDisplayName; DisplayNameProposedStatus = GetProposedDisplayNameStatus(displayName.proposedStatus); } }
private void HandleMixSessionStartSuccess(IEnumerable <IInvalidProfileItemError> errorList, string swid, Profile profile, Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName, IEnumerable <Disney.Mix.SDK.Internal.GuestControllerDomain.MarketingItem> marketing, Action <IRegisterResult> callback) { try { IInternalSession session = sessionFactory.Create(swid); IInternalLocalUser internalLocalUser = session.InternalLocalUser; internalLocalUser.InternalRegistrationProfile.Update(profile, displayName, marketing); session.Resume(delegate(IResumeSessionResult r) { HandleOfflineSessionResumed(r, session, errorList, callback); }); } catch (Exception ex) { logger.Critical("Error creating session: " + ex); callback(new RegisterResult(success: false, null, null)); } }
private void HandleMixSessionStartSuccess(Action <ILoginResult> callback, ILoginResult loginResult, string swid, GuestApiErrorCollection gcErrorCollection, Profile profile, Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName, IEnumerable <Disney.Mix.SDK.Internal.GuestControllerDomain.MarketingItem> marketing) { try { IInternalSession session = sessionFactory.Create(swid); IInternalLocalUser internalLocalUser = session.InternalLocalUser; internalLocalUser.InternalRegistrationProfile.Update(profile, displayName, marketing); session.Resume(delegate(IResumeSessionResult r) { HandleOfflineSessionResumed(r, session, loginResult, gcErrorCollection, callback); }); } catch (Exception arg) { logger.Critical("Error creating session: " + arg); callback(new LoginResult(success: false, null)); } }
private void HandleRefreshProfileSuccess(Action <ILoginResult> callback, ILoginResult loginResult, GuestApiErrorCollection gcErrorCollection, Profile profile, Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName, IEnumerable <Disney.Mix.SDK.Internal.GuestControllerDomain.MarketingItem> marketing, string swid, string accessToken) { mixSessionStarter.Start(swid, accessToken, delegate { HandleMixSessionStartSuccess(callback, loginResult, swid, gcErrorCollection, profile, displayName, marketing); }, delegate { callback(new LoginResult(success: false, null)); }); }
private void StoreSession(string swid, string accessToken, string refreshToken, string etag, Disney.Mix.SDK.Internal.GuestControllerDomain.DisplayName displayName, Profile profile) { string countryCode = GuestControllerUtils.GetCountryCode(profile); database.StoreSession(swid, accessToken, refreshToken, displayName.displayName, profile.firstName, etag, profile.ageBand, displayName.proposedDisplayName, displayName.proposedStatus, profile.status, updateLastProfileRefreshTime: true, countryCode); }