Ejemplo n.º 1
0
        private async void Authenticate(IAuthenticatedContext context)
        {
            Settings.IValues settings = _settingsProvider.GetValues();

            try
            {
                Hub.Session.IInfo sessionInfo = await _authenticationProvider.AuthenticateAsync(settings.HarmonyHubAddress, context.AuthenticationToken);

                ISessionContext sessionContext = context.ForSession(sessionInfo);

                _messageMediator.Publish(new TransitionToStateMessage <ISessionContext>(Name.EstablishingSession, sessionContext));
            }
            catch
            {
                _messageMediator.Publish(new TransitionToStateMessage <IContext>(Name.Stopped, context));
            }
        }
Ejemplo n.º 2
0
 public PrivateContext(IActiveContext context, Hub.Session.IInfo sessionInfo, Hub.Session.IInstance session, Hub.Configuration.IValues harmonyConfiguration) : this((ISessionContext)context, context.SessionInfo, context.Session)
 {
     _harmonyConfiguration = harmonyConfiguration;
 }
Ejemplo n.º 3
0
 public PrivateContext(ISessionContext context, Hub.Session.IInfo sessionInfo, Hub.Session.IInstance session) : this(context)
 {
     _session = session;
 }
Ejemplo n.º 4
0
 public PrivateContext(IAuthenticatedContext context, Hub.Session.IInfo sessionInfo) : this(context, context.AccountId, context.AuthenticationToken)
 {
     _sessionInfo = sessionInfo;
 }
Ejemplo n.º 5
0
 public static IActiveContext Activate(this ISessionContext context, Hub.Session.IInfo sessionInfo, Hub.Session.IInstance session)
 {
     return(new PrivateContext(context, sessionInfo, session));
 }
Ejemplo n.º 6
0
 public static ISessionContext ForSession(this IAuthenticatedContext context, Hub.Session.IInfo sessionInfo)
 {
     return(new PrivateContext(context, sessionInfo));
 }
Ejemplo n.º 7
0
 public PrivateContext(IAuthenticatedContext context, Hub.Session.IInfo sessionInfo) : this(context, context.AccountId, context.AuthenticationToken)
 {
     _sessionInfo = sessionInfo;
 }