/// <summary> /// Creates an interactive 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="interactiveGame">The game to use</param> /// <param name="version">The version of the game to use</param> /// <returns>The interactive client for the specified channel and game</returns> public static async Task <InteractiveClient> CreateFromChannel(MixerConnection connection, ChannelModel channel, InteractiveGameModel interactiveGame, InteractiveGameVersionModel version) { Validator.ValidateVariable(connection, "connection"); Validator.ValidateVariable(channel, "channel"); Validator.ValidateVariable(interactiveGame, "interactiveGame"); Validator.ValidateVariable(version, "version"); return(await InteractiveClient.CreateFromChannel(connection, channel, interactiveGame, version, null)); }
/// <summary> /// Creates an interactive 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="interactiveGame">The game to use</param> /// <returns>The interactive client for the specified channel and game</returns> public static async Task <InteractiveClient> CreateFromChannel(MixerConnection connection, ChannelModel channel, InteractiveGameListingModel interactiveGame) { Validator.ValidateVariable(connection, "connection"); Validator.ValidateVariable(channel, "channel"); Validator.ValidateVariable(interactiveGame, "interactiveGame"); Validator.ValidateList(interactiveGame.versions, "interactiveGame.versions"); return(await InteractiveClient.CreateFromChannel(connection, channel, interactiveGame, interactiveGame.versions.OrderByDescending(v => v.versionOrder).First())); }
/// <summary> /// Helper method to handle the reconnection of a web socket client. This method will return when /// a connection is able to successfully be established via the Connect() method. This method /// WILL NOT call any subsequent establishment methods (EX: Authenticate(), Ready(), etc). /// </summary> /// <param name="client">The web socket client to reconnect</param> /// <returns>A task for the reconnection of the websocket</returns> public static async Task Reconnect(InteractiveClient client) { await WebSocketClientBase.ReconnectionHelper(client); }