Пример #1
0
        /// <summary>
        /// Creates an MixPlay client using the specified connection to the specified channel and game.
        /// </summary>
        /// <param name="connection">The connection to use</param>
        /// <param name="channel">The channel to connect to</param>
        /// <param name="game">The game to use</param>
        /// <param name="version">The version of the game to use</param>
        /// <returns>The MixPlay client for the specified channel and game</returns>
        public static async Task <MixPlayClient> CreateFromChannel(MixerConnection connection, ChannelModel channel, MixPlayGameModel game, MixPlayGameVersionModel version)
        {
            Validator.ValidateVariable(connection, "connection");
            Validator.ValidateVariable(channel, "channel");
            Validator.ValidateVariable(game, "game");
            Validator.ValidateVariable(version, "version");

            return(await MixPlayClient.CreateFromChannel(connection, channel, game, version, null));
        }
Пример #2
0
        /// <summary>
        /// Creates an MixPlay client using the specified connection to the specified channel and game.
        /// </summary>
        /// <param name="connection">The connection to use</param>
        /// <param name="channel">The channel to connect to</param>
        /// <param name="gameListing">The game to use</param>
        /// <returns>The MixPlay client for the specified channel and game</returns>
        public static async Task <MixPlayClient> CreateFromChannel(MixerConnection connection, ChannelModel channel, MixPlayGameListingModel gameListing)
        {
            Validator.ValidateVariable(connection, "connection");
            Validator.ValidateVariable(channel, "channel");
            Validator.ValidateVariable(gameListing, "gameListing");
            Validator.ValidateList(gameListing.versions, "gameListing.versions");

            return(await MixPlayClient.CreateFromChannel(connection, channel, gameListing, gameListing.versions.OrderByDescending(v => v.versionOrder).First()));
        }