/// <summary>
        /// Removes the specified user from the console.
        /// </summary>
        /// <param name="systemIpAddress">The system IP address of the console.</param>
        /// <param name="user">The user to be removed.</param>
        /// <remarks>A signed-in user is signed out before being removed from the console.</remarks>
        public void DeleteUser(string systemIpAddress, XboxUserDefinition user)
        {
            this.ThrowIfDisposed();
            this.ThrowIfInvalidSystemIpAddress(systemIpAddress);

            this.PerformXdkAction(
                systemIpAddress,
                () => this.DeleteUserImpl(systemIpAddress, user),
                "Failed to delete user.");
        }
        /// <summary>
        /// Signs out the given user.
        /// </summary>
        /// <param name="systemIpAddress">The system IP address of the console.</param>
        /// <param name="user">The user to sign-out.</param>
        /// <returns>An XboxUserDefinition of the signed-out user.</returns>
        public XboxUserDefinition SignOutUser(string systemIpAddress, XboxUserDefinition user)
        {
            this.ThrowIfDisposed();
            this.ThrowIfInvalidSystemIpAddress(systemIpAddress);

            return(this.PerformXdkFunc(
                       systemIpAddress,
                       () => this.SignOutUserImpl(systemIpAddress, user),
                       "Failed to sign-out user."));
        }
        /// <summary>
        /// Signs the given user into Xbox Live.
        /// </summary>
        /// <param name="systemIpAddress">The system IP address of the console.</param>
        /// <param name="user">The user to sign in.</param>
        /// <param name="password">The password of the for signing in. If a password has been stored on the console, <c>null</c> can be passed in.</param>
        /// <param name="storePassword">If <c>true</c>, saves the given password on the console for later use.</param>
        /// <returns>An XboxUserDefinition of the signed-in user.</returns>
        public XboxUserDefinition SignInUser(string systemIpAddress, XboxUserDefinition user, string password, bool storePassword)
        {
            this.ThrowIfDisposed();
            this.ThrowIfInvalidSystemIpAddress(systemIpAddress);

            return(this.PerformXdkFunc(
                       systemIpAddress,
                       () => this.SignInUserImpl(systemIpAddress, user, password, storePassword),
                       "Failed to sign-in user."));
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the XboxUser class.
        /// </summary>
        /// <param name="console">The XboxConsole on which the virtual user was created.</param>
        /// <param name="userData">The user data of the user.</param>
        internal XboxUser(XboxConsole console, XboxUserDefinition userData)
            : base(console)
        {
            if (userData == null)
            {
                throw new ArgumentNullException("userData", "userData can't be null");
            }

            this.Definition = userData;
        }
Esempio n. 5
0
        /// <summary>
        /// Signs out the user.
        /// </summary>
        public void SignOut()
        {
            var newDefinition = this.Console.Adapter.SignOutUser(this.Console.SystemIpAddressAndSessionKeyCombined, this.Definition);

            if (newDefinition == null || newDefinition.EmailAddress != this.EmailAddress)
            {
                throw new XboxSignInException("Unable to verify that the user has been signed out.");
            }

            this.Definition = newDefinition;
        }
Esempio n. 6
0
        /// <summary>
        /// Signs in the user.
        /// </summary>
        /// <param name="password">The password of the for signing in. If a password has been stored on the console, <c>null</c> can be passed in.</param>
        /// <param name="storePassword">If <c>true</c>, saves the given password on the console for later use.</param>
        /// <remarks>
        /// In this release, the password text is not encrypted when it is passed over the network to the console by SignIn.
        /// If this is a concern in your network environment, then use the Sign-In app on the console to sign in the user and
        /// store the user password. (The Sign-In app sends the password over the network encrypted.) After this, you can
        /// subsequently use Signin to sign in without passing a password.
        /// </remarks>
        public void SignIn(string password, bool storePassword)
        {
            var newDefinition = this.Console.Adapter.SignInUser(this.Console.SystemIpAddressAndSessionKeyCombined, this.Definition, password, storePassword);

            if (newDefinition == null || newDefinition.EmailAddress != this.EmailAddress)
            {
                throw new XboxSignInException("Unable to verify that the user has been signed in.");
            }

            this.Definition = newDefinition;
        }
Esempio n. 7
0
 /// <summary>
 /// Signs out the given user.
 /// </summary>
 /// <param name="ipAddress">The IP address of the console.</param>
 /// <param name="user">The user to sign-out.</param>
 /// <returns>An XboxUserDefinition of the signed-out user.</returns>
 public virtual XboxUserDefinition SignOutUser(string ipAddress, XboxUserDefinition user)
 {
     throw new XboxConsoleFeatureNotSupportedException(NotSupportedMessage);
 }
Esempio n. 8
0
 /// <summary>
 /// Signs the given user into Xbox Live.
 /// </summary>
 /// <param name="ipAddress">The IP address of the console.</param>
 /// <param name="user">The user to sign in.</param>
 /// <param name="password">The password of the for signing in. If a password has been stored on the console, <c>null</c> can be passed in.</param>
 /// <param name="storePassword">If <c>true</c>, saves the given password on the console for later use.</param>
 /// <returns>An XboxUserDefinition of the signed-in user.</returns>
 public virtual XboxUserDefinition SignInUser(string ipAddress, XboxUserDefinition user, string password, bool storePassword)
 {
     throw new XboxConsoleFeatureNotSupportedException(NotSupportedMessage);
 }
 /// <summary>
 /// Signs out the given user.
 /// </summary>
 /// <param name="systemIpAddress">The system IP address of the console.</param>
 /// <param name="user">The user to sign-out.</param>
 /// <returns>An XboxUserDefinition of the signed-out user.</returns>
 protected virtual XboxUserDefinition SignOutUserImpl(string systemIpAddress, XboxUserDefinition user)
 {
     throw new XboxConsoleFeatureNotSupportedException(NotSupportedMessage);
 }
 /// <summary>
 /// Signs the given user into Xbox Live.
 /// </summary>
 /// <param name="systemIpAddress">The system IP address of the console.</param>
 /// <param name="user">The user to sign in.</param>
 /// <param name="password">The password of the for signing in. If a password has been stored on the console, <c>null</c> can be passed in.</param>
 /// <param name="storePassword">If <c>true</c>, saves the given password on the console for later use.</param>
 /// <returns>An XboxUserDefinition of the signed-in user.</returns>
 protected virtual XboxUserDefinition SignInUserImpl(string systemIpAddress, XboxUserDefinition user, string password, bool storePassword)
 {
     throw new XboxConsoleFeatureNotSupportedException(NotSupportedMessage);
 }