Ejemplo n.º 1
0
        /// <summary>
        /// Gets a Mage client from the list of active Mage clients. The client selected is the
        /// one in which the currently logged-in player matches the specified name.
        /// </summary>
        /// <param name="name">The name of the player logged into the client.</param>
        /// <returns>The Mage client that is logged in as the specified player.</returns>

        public MageClient GetMage(string name)
        {
            var client = Mages.FirstOrDefault(x => string.Equals(name, x.Self.Name, StringComparison.OrdinalIgnoreCase));

            if (client == null)
            {
                ThrowNullReferenceException("Mage", name);
            }

            return(client);
        }