Esempio n. 1
0
        public async Task RefreshCachedControls()
        {
            this.Scenes.Clear();
            this.Controls.Clear();
            this.ControlCommands.Clear();

            // Initialize Scenes
            InteractiveConnectedSceneGroupCollectionModel scenes = await this.GetScenes();

            if (scenes != null)
            {
                foreach (InteractiveConnectedSceneModel scene in scenes.scenes)
                {
                    this.Scenes.Add(scene);

                    InteractiveSceneModel dataScene = this.Version.controls.scenes.FirstOrDefault(s => s.sceneID.Equals(scene.sceneID));

                    foreach (InteractiveConnectedButtonControlModel button in scene.buttons)
                    {
                        if (dataScene != null)
                        {
                            InteractiveButtonControlModel dataButton = dataScene.buttons.FirstOrDefault(b => b.controlID.Equals(button.controlID));
                            if (dataButton != null)
                            {
                                button.text    = dataButton.text;
                                button.tooltip = dataButton.tooltip;
                            }
                        }

                        this.Controls[button.controlID] = button;

                        this.AddConnectedControl(scene, button);
                    }

                    foreach (InteractiveConnectedJoystickControlModel joystick in scene.joysticks)
                    {
                        this.Controls[joystick.controlID] = joystick;

                        this.AddConnectedControl(scene, joystick);
                    }

                    foreach (InteractiveConnectedTextBoxControlModel textBox in scene.textBoxes)
                    {
                        if (dataScene != null)
                        {
                            InteractiveTextBoxControlModel dataTextBox = dataScene.textBoxes.FirstOrDefault(b => b.controlID.Equals(textBox.controlID));
                            if (dataTextBox != null)
                            {
                                textBox.placeholder = dataTextBox.placeholder;
                                textBox.submitText  = dataTextBox.submitText;
                            }
                        }

                        this.Controls[textBox.controlID] = textBox;

                        this.AddConnectedControl(scene, textBox);
                    }
                }
            }
        }
Esempio n. 2
0
 public InteractiveCommand(InteractiveGameListingModel game, InteractiveSceneModel scene, InteractiveJoystickControlModel control)
     : base(control.controlID, CommandTypeEnum.Interactive, string.Empty)
 {
     this.GameID  = game.id;
     this.SceneID = scene.sceneID;
     this.Control = control;
 }
Esempio n. 3
0
        protected override async Task OnLoaded()
        {
            this.CooldownTypeComboBox.ItemsSource = new List <string>()
            {
                "By Itself", "With All Buttons"
            };
            this.CooldownTypeComboBox.SelectedIndex = 0;

            if (this.command != null)
            {
                if (this.game != null)
                {
                    this.scene  = this.version.controls.scenes.FirstOrDefault(s => s.sceneID.Equals(this.command.SceneID));
                    this.button = this.command.Button;
                }

                this.SparkCostTextBox.Text = this.command.Button.cost.ToString();
                if (this.command.Requirements.Cooldown != null && this.command.Requirements.Cooldown.IsGroup)
                {
                    this.CooldownTypeComboBox.SelectedIndex = 1;
                }
                else
                {
                    this.CooldownTypeComboBox.SelectedIndex = 0;
                    this.CooldownTextBox.Text = this.command.CooldownAmount.ToString();
                }

                if (this.command.Actions.First() is ChatAction)
                {
                    this.actionControl = new ChatActionControl(null, (ChatAction)this.command.Actions.First());
                }
                else if (this.command.Actions.First() is SoundAction)
                {
                    this.actionControl = new SoundActionControl(null, (SoundAction)this.command.Actions.First());
                }
            }
            else
            {
                this.SparkCostTextBox.Text = this.button.cost.ToString();
                this.CooldownTextBox.Text  = "0";

                if (this.commandType == BasicCommandTypeEnum.Chat)
                {
                    this.actionControl = new ChatActionControl(null);
                }
                else if (this.commandType == BasicCommandTypeEnum.Sound)
                {
                    this.actionControl = new SoundActionControl(null);
                }
            }

            if (string.IsNullOrEmpty(this.SparkCostTextBox.Text))
            {
                this.SparkCostTextBox.Text = "0";
            }

            this.ActionControlControl.Content = this.actionControl;

            await base.OnLoaded();
        }
 protected InteractiveCommand(InteractiveGameModel game, InteractiveSceneModel scene, InteractiveControlModel control, string command, RequirementViewModel requirements)
     : base(control.controlID, CommandTypeEnum.Interactive, command, requirements)
 {
     this.GameID  = game.id;
     this.SceneID = scene.sceneID;
     this.Control = control;
 }
Esempio n. 5
0
 public InteractiveCommand(InteractiveGameListingModel game, InteractiveSceneModel scene, InteractiveButtonControlModel control, InteractiveButtonCommandTriggerType eventType)
     : base(control.controlID, CommandTypeEnum.Interactive, EnumHelper.GetEnumName(eventType))
 {
     this.GameID  = game.id;
     this.SceneID = scene.sceneID;
     this.Control = control;
     this.Trigger = eventType;
 }
 private void InteractiveScenesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.InteractiveScenesComboBox.SelectedIndex >= 0)
     {
         this.selectedScene = (InteractiveSceneModel)this.InteractiveScenesComboBox.SelectedItem;
         this.RefreshSelectedScene();
     }
 }
        public InteractiveSceneUserGroupsDialogControl(InteractiveGameModel game, InteractiveSceneModel scene)
        {
            this.game  = game;
            this.scene = scene;

            InitializeComponent();

            this.UserGroups = new ObservableCollection <GroupListItem>();

            this.Loaded += InteractiveSceneUserGroupsDialogControl_Loaded;
        }
Esempio n. 8
0
        public BasicInteractiveButtonCommandEditorControl(CommandWindow window, InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveSceneModel scene,
                                                          InteractiveButtonControlModel button, BasicCommandTypeEnum commandType)
        {
            this.window      = window;
            this.game        = game;
            this.version     = version;
            this.scene       = scene;
            this.button      = button;
            this.commandType = commandType;

            InitializeComponent();
        }
        public BasicInteractiveTextBoxCommandEditorControl(CommandWindow window, InteractiveGameListingModel game, InteractiveGameVersionModel version, InteractiveSceneModel scene,
                                                           InteractiveTextBoxControlModel textBox, BasicCommandTypeEnum commandType)
        {
            this.window      = window;
            this.game        = game;
            this.version     = version;
            this.scene       = scene;
            this.textBox     = textBox;
            this.commandType = commandType;

            InitializeComponent();
        }
        protected override async Task OnLoaded()
        {
            this.TextValueSpecialIdentifierTextBlock.Text = SpecialIdentifierStringBuilder.InteractiveTextBoxTextEntrySpecialIdentifierHelpText;

            if (this.command != null)
            {
                IEnumerable <InteractiveGameListingModel> games = await ChannelSession.Connection.GetOwnedInteractiveGames(ChannelSession.Channel);

                this.game = games.FirstOrDefault(g => g.name.Equals(this.command.GameID));
                if (this.game != null)
                {
                    this.version = this.game.versions.First();
                    this.version = await ChannelSession.Connection.GetInteractiveGameVersion(this.version);

                    this.scene   = this.version.controls.scenes.FirstOrDefault(s => s.sceneID.Equals(this.command.SceneID));
                    this.textBox = this.command.TextBox;
                }

                this.SparkCostTextBox.Text = this.command.TextBox.cost.ToString();
                this.UseChatModerationCheckBox.IsChecked = this.command.UseChatModeration;

                if (this.command.Actions.First() is ChatAction)
                {
                    this.actionControl = new ChatActionControl(null, (ChatAction)this.command.Actions.First());
                }
                else if (this.command.Actions.First() is SoundAction)
                {
                    this.actionControl = new SoundActionControl(null, (SoundAction)this.command.Actions.First());
                }
            }
            else
            {
                this.SparkCostTextBox.Text = this.textBox.cost.ToString();

                if (this.commandType == BasicCommandTypeEnum.Chat)
                {
                    this.actionControl = new ChatActionControl(null);
                }
                else if (this.commandType == BasicCommandTypeEnum.Sound)
                {
                    this.actionControl = new SoundActionControl(null);
                }
            }

            this.ActionControlControl.Content = this.actionControl;

            await base.OnLoaded();
        }
        public InteractiveSceneModel GetSceneData()
        {
            InteractiveSceneModel scene = new InteractiveSceneModel()
            {
                sceneID = this.Name
            };

            foreach (ItemViewModel item in this.Items)
            {
                if (item.Interactive != null)
                {
                    item.Interactive.ID = item.Name;
                    scene.buttons.Add(item.Interactive.GetInteractiveControl());
                }
            }
            return(scene);
        }
Esempio n. 12
0
        public async Task Save()
        {
            if (string.IsNullOrEmpty(this.GameNameTextBox.Text))
            {
                await MessageBoxHelper.ShowMessageDialog("A name must be specified for the game");

                return;
            }

            InteractiveGameListingModel game = await this.RunAsyncOperation(async() =>
            {
                InteractiveSceneModel defaultScene = InteractiveGameHelper.CreateDefaultScene();
                return(await ChannelSession.Connection.CreateInteractiveGame(ChannelSession.Channel, ChannelSession.User, this.GameNameTextBox.Text, InteractiveGameHelper.CreateDefaultScene()));
            });

            if (game == null)
            {
                await MessageBoxHelper.ShowMessageDialog("Failed to create game");

                return;
            }
        }
Esempio n. 13
0
        public static async Task <InteractiveGameListingModel> CreateInteractive2Game(MixerConnection connection, ChannelModel channel, UserModel user, string gameName, InteractiveSceneModel initialScene)
        {
            InteractiveGameModel game = new InteractiveGameModel()
            {
                name    = gameName,
                ownerId = user.id,
            };

            game = await connection.Interactive.CreateInteractiveGame(game);

            game.controlVersion = "2.0";
            game = await connection.Interactive.UpdateInteractiveGame(game);

            IEnumerable <InteractiveGameListingModel> gameListings = await connection.Interactive.GetOwnedInteractiveGames(channel);

            InteractiveGameListingModel gameListing = gameListings.FirstOrDefault(gl => gl.id.Equals(game.id));

            InteractiveGameVersionModel version = gameListing.versions.First();

            version.controls.scenes.Add(initialScene);
            version.controlVersion = "2.0";
            version = await connection.Interactive.UpdateInteractiveGameVersion(version);

            gameListings = await connection.Interactive.GetOwnedInteractiveGames(channel);

            gameListing = gameListings.FirstOrDefault(gl => gl.id.Equals(game.id));

            return(gameListing);
        }
        public static async Task <InteractiveGameListingModel> CreateTestGame(MixerConnection connection, ChannelModel channel)
        {
            UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);

            IEnumerable <InteractiveGameListingModel> gameListings = await connection.Interactive.GetOwnedInteractiveGames(channel);

            InteractiveGameListingModel previousTestGame = gameListings.FirstOrDefault(g => g.name.Equals(InteractiveServiceUnitTests.InteractiveGameName));

            if (previousTestGame != null)
            {
                await InteractiveServiceUnitTests.DeleteTestGame(connection, previousTestGame);
            }

            InteractiveGameModel game = new InteractiveGameModel()
            {
                name    = InteractiveServiceUnitTests.InteractiveGameName,
                ownerId = user.id,
            };

            game = await connection.Interactive.CreateInteractiveGame(game);

            Assert.IsNotNull(game);
            Assert.IsTrue(game.id > 0);

            game.controlVersion = "2.0";
            game = await connection.Interactive.UpdateInteractiveGame(game);

            Assert.IsNotNull(game);
            Assert.IsTrue(game.id > 0);

            gameListings = await connection.Interactive.GetOwnedInteractiveGames(channel);

            Assert.IsNotNull(gameListings);
            Assert.IsTrue(gameListings.Count() > 0);

            InteractiveGameListingModel gameListing = gameListings.FirstOrDefault(gl => gl.id.Equals(game.id));

            Assert.IsNotNull(gameListing);

            InteractiveGameVersionModel version      = gameListing.versions.First();
            InteractiveSceneModel       defaultScene = new InteractiveSceneModel()
            {
                sceneID = "default",
            };

            defaultScene.buttons.Add(InteractiveClientUnitTests.CreateTestButton());
            defaultScene.joysticks.Add(InteractiveClientUnitTests.CreateTestJoystick());

            version.controls.scenes.Add(defaultScene);
            version.controlVersion = "2.0";
            version = await connection.Interactive.UpdateInteractiveGameVersion(version);

            gameListings = await connection.Interactive.GetOwnedInteractiveGames(channel);

            Assert.IsNotNull(gameListings);
            Assert.IsTrue(gameListings.Count() > 0);

            gameListing = gameListings.FirstOrDefault(gl => gl.id.Equals(game.id));
            Assert.IsNotNull(gameListing);

            return(gameListing);
        }
 public GroupListItem(InteractiveUserGroupViewModel group, InteractiveSceneModel scene)
 {
     this.Group        = group;
     this.Scene        = scene;
     this.SetAsDefault = this.Group.DefaultScene.Equals(this.Scene.sceneID);
 }
Esempio n. 16
0
        public InteractiveTextBoxCommandDetailsControl(InteractiveGameListingModel game, InteractiveGameVersionModel version, InteractiveSceneModel scene, InteractiveTextBoxControlModel control)
        {
            this.Game    = game;
            this.Version = version;
            this.Scene   = scene;
            this.Control = control;

            InitializeComponent();
        }
Esempio n. 17
0
        protected override async Task OnLoaded()
        {
            this.CooldownTypeComboBox.ItemsSource = new List <string>()
            {
                "By Itself", "With All Buttons"
            };

            if (this.command != null)
            {
                IEnumerable <InteractiveGameListingModel> games = await ChannelSession.Connection.GetOwnedInteractiveGames(ChannelSession.Channel);

                this.game = games.FirstOrDefault(g => g.name.Equals(this.command.GameID));
                if (this.game != null)
                {
                    this.version = this.game.versions.First();
                    this.version = await ChannelSession.Connection.GetInteractiveGameVersion(this.version);

                    this.scene  = this.version.controls.scenes.FirstOrDefault(s => s.sceneID.Equals(this.command.SceneID));
                    this.button = this.command.Button;
                }
            }

            if (this.command != null)
            {
                this.SparkCostTextBox.Text = this.command.Button.cost.ToString();
                if (!string.IsNullOrEmpty(this.command.CooldownGroup))
                {
                    this.CooldownTypeComboBox.SelectedIndex = 1;
                }
                else
                {
                    this.CooldownTypeComboBox.SelectedIndex = 0;
                    this.CooldownTextBox.Text = this.command.CooldownAmount.ToString();
                }

                if (this.command.Actions.First() is ChatAction)
                {
                    this.actionControl = new ChatActionControl(null, (ChatAction)this.command.Actions.First());
                }
                else if (this.command.Actions.First() is SoundAction)
                {
                    this.actionControl = new SoundActionControl(null, (SoundAction)this.command.Actions.First());
                }
            }
            else
            {
                this.SparkCostTextBox.Text = this.button.cost.ToString();
                this.CooldownTextBox.Text  = "0";

                if (this.commandType == BasicCommandTypeEnum.Chat)
                {
                    this.actionControl = new ChatActionControl(null);
                }
                else if (this.commandType == BasicCommandTypeEnum.Sound)
                {
                    this.actionControl = new SoundActionControl(null);
                }
            }

            this.ActionControlControl.Content = this.actionControl;

            await base.OnLoaded();
        }
        private async Task FinalizeNewUser()
        {
            if (this.scorpBotData != null)
            {
                // Import Ranks
                int    rankEnabled   = int.Parse(this.scorpBotData.GetSettingsValue("currency", "enabled", "0"));
                string rankName      = this.scorpBotData.GetSettingsValue("currency", "name", "Rank");
                int    rankInterval  = int.Parse(this.scorpBotData.GetSettingsValue("currency", "onlinepayinterval", "0"));
                int    rankAmount    = int.Parse(this.scorpBotData.GetSettingsValue("currency", "activeuserbonus", "0"));
                int    rankMaxAmount = int.Parse(this.scorpBotData.GetSettingsValue("currency", "maxlimit", "-1"));
                if (rankMaxAmount <= 0)
                {
                    rankMaxAmount = int.MaxValue;
                }
                int    rankOnFollowBonus    = int.Parse(this.scorpBotData.GetSettingsValue("currency", "onfollowbonus", "0"));
                int    rankOnSubBonus       = int.Parse(this.scorpBotData.GetSettingsValue("currency", "onsubbonus", "0"));
                int    rankSubBonus         = int.Parse(this.scorpBotData.GetSettingsValue("currency", "subbonus", "0"));
                string rankCommand          = this.scorpBotData.GetSettingsValue("currency", "command", "");
                string rankCommandResponse  = this.scorpBotData.GetSettingsValue("currency", "response", "");
                string rankUpCommand        = this.scorpBotData.GetSettingsValue("currency", "Currency1RankUpMsg", "");
                int    rankAccumulationType = int.Parse(this.scorpBotData.GetSettingsValue("currency", "ranksrectype", "0"));

                UserCurrencyViewModel rankCurrency       = null;
                UserCurrencyViewModel rankPointsCurrency = null;
                if (rankEnabled == 1 && !string.IsNullOrEmpty(rankName))
                {
                    if (rankAccumulationType == 1)
                    {
                        rankCurrency = new UserCurrencyViewModel()
                        {
                            Name = rankName.Equals("Points") ? "Hours" : rankName,
                            SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(rankName.Equals("Points") ? "Hours" : rankName),
                            AcquireInterval   = 60,
                            AcquireAmount     = 1,
                            MaxAmount         = rankMaxAmount,
                        };

                        if (rankInterval >= 0 && rankAmount >= 0)
                        {
                            rankPointsCurrency = new UserCurrencyViewModel()
                            {
                                Name = "Points",
                                SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier("points"),
                                AcquireInterval   = rankInterval,
                                AcquireAmount     = rankAmount,
                                MaxAmount         = rankMaxAmount,
                                OnFollowBonus     = rankOnFollowBonus,
                                OnSubscribeBonus  = rankOnSubBonus,
                                SubscriberBonus   = rankSubBonus
                            };

                            ChannelSession.Settings.Currencies[rankPointsCurrency.ID] = rankPointsCurrency;
                        }
                    }
                    else if (rankInterval >= 0 && rankAmount >= 0)
                    {
                        rankCurrency = new UserCurrencyViewModel()
                        {
                            Name = rankName,
                            SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(rankName),
                            AcquireInterval   = rankInterval,
                            AcquireAmount     = rankAmount,
                            MaxAmount         = rankMaxAmount,
                            OnFollowBonus     = rankOnFollowBonus,
                            OnSubscribeBonus  = rankOnSubBonus,
                            SubscriberBonus   = rankSubBonus
                        };
                    }
                }

                // Import Currency
                int    currencyEnabled   = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "enabled", "0"));
                string currencyName      = this.scorpBotData.GetSettingsValue("currency2", "name", "Currency");
                int    currencyInterval  = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "onlinepayinterval", "0"));
                int    currencyAmount    = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "activeuserbonus", "0"));
                int    currencyMaxAmount = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "maxlimit", "-1"));
                if (currencyMaxAmount <= 0)
                {
                    currencyMaxAmount = int.MaxValue;
                }
                int    currencyOnFollowBonus   = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "onfollowbonus", "0"));
                int    currencyOnSubBonus      = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "onsubbonus", "0"));
                int    currencySubBonus        = int.Parse(this.scorpBotData.GetSettingsValue("currency2", "subbonus", "0"));
                string currencyCommand         = this.scorpBotData.GetSettingsValue("currency2", "command", "");
                string currencyCommandResponse = this.scorpBotData.GetSettingsValue("currency2", "response", "");

                UserCurrencyViewModel currency = null;
                if (currencyEnabled == 1 && !string.IsNullOrEmpty(currencyName) && currencyInterval >= 0 && currencyAmount >= 0)
                {
                    currency = new UserCurrencyViewModel()
                    {
                        Name            = currencyName, SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(currencyName), AcquireInterval = currencyInterval,
                        AcquireAmount   = currencyAmount, MaxAmount = currencyMaxAmount, OnFollowBonus = currencyOnFollowBonus, OnSubscribeBonus = currencyOnSubBonus,
                        SubscriberBonus = currencySubBonus
                    };
                    ChannelSession.Settings.Currencies[currency.ID] = currency;

                    if (!string.IsNullOrEmpty(currencyCommand) && !string.IsNullOrEmpty(currencyCommandResponse))
                    {
                        currencyCommandResponse = currencyCommandResponse.Replace("$points2", "$" + currency.UserAmountSpecialIdentifier);
                        currencyCommandResponse = currencyCommandResponse.Replace("$currencyname2", currency.Name);
                        this.scorpBotData.Commands.Add(new ScorpBotCommand(currencyCommand, currencyCommandResponse));
                    }
                }

                foreach (ScorpBotViewer viewer in this.scorpBotData.Viewers)
                {
                    ChannelSession.Settings.UserData[viewer.ID] = new UserDataViewModel(viewer);

                    if (rankPointsCurrency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(rankPointsCurrency, (int)viewer.RankPoints);
                    }

                    if (rankCurrency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(rankCurrency, (rankPointsCurrency != null) ? (int)viewer.Hours : (int)viewer.RankPoints);
                    }

                    if (currency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(currency, (int)viewer.Currency);
                    }
                }

                if (rankCurrency != null)
                {
                    ChannelSession.Settings.Currencies[rankCurrency.ID] = rankCurrency;

                    foreach (ScorpBotRank rank in this.scorpBotData.Ranks)
                    {
                        rankCurrency.Ranks.Add(new UserRankViewModel(rank.Name, rank.Amount));
                    }

                    if (!string.IsNullOrEmpty(rankCommand) && !string.IsNullOrEmpty(rankCommandResponse))
                    {
                        rankCommandResponse = rankCommandResponse.Replace(" / Raids: $raids", "");
                        rankCommandResponse = rankCommandResponse.Replace("$rank", "$" + rankCurrency.UserRankNameSpecialIdentifier);
                        rankCommandResponse = rankCommandResponse.Replace("$points", "$" + rankCurrency.UserAmountSpecialIdentifier);
                        rankCommandResponse = rankCommandResponse.Replace("$currencyname", rankCurrency.Name);
                        this.scorpBotData.Commands.Add(new ScorpBotCommand(rankCommand, rankCommandResponse));
                    }

                    if (!string.IsNullOrEmpty(rankUpCommand))
                    {
                        rankUpCommand = rankUpCommand.Replace("$rank", "$" + rankCurrency.UserRankNameSpecialIdentifier);
                        rankUpCommand = rankUpCommand.Replace("$points", "$" + rankCurrency.UserAmountSpecialIdentifier);
                        rankUpCommand = rankUpCommand.Replace("$currencyname", rankCurrency.Name);

                        ScorpBotCommand scorpCommand = new ScorpBotCommand("rankup", rankUpCommand);
                        ChatCommand     chatCommand  = new ChatCommand(scorpCommand);

                        rankCurrency.RankChangedCommand = new CustomCommand("User Rank Changed");
                        rankCurrency.RankChangedCommand.Actions.AddRange(chatCommand.Actions);
                    }
                }

                foreach (ScorpBotCommand command in this.scorpBotData.Commands)
                {
                    ChannelSession.Settings.ChatCommands.Add(new ChatCommand(command));
                }

                foreach (ScorpBotTimer timer in this.scorpBotData.Timers)
                {
                    ChannelSession.Settings.TimerCommands.Add(new TimerCommand(timer));
                }

                foreach (string quote in this.scorpBotData.Quotes)
                {
                    ChannelSession.Settings.UserQuotes.Add(new UserQuoteViewModel(quote));
                }

                if (ChannelSession.Settings.UserQuotes.Count > 0)
                {
                    ChannelSession.Settings.QuotesEnabled = true;
                }

                foreach (string bannedWord in this.scorpBotData.BannedWords)
                {
                    ChannelSession.Settings.BannedWords.Add(bannedWord);
                }
            }

            if (this.soundwaveData != null && this.soundwaveProfiles != null && this.soundwaveProfiles.Count(p => p.AddProfile) > 0)
            {
                if (this.soundwaveData.StaticCooldown)
                {
                    ChannelSession.Settings.InteractiveCooldownGroups.Add(SoundwaveInteractiveCooldownGroupName, this.soundwaveData.StaticCooldownAmount / 1000);
                }

                InteractiveGameListingModel soundwaveGame = this.interactiveGames.FirstOrDefault(g => g.name.Equals(SoundwaveInteractiveGameName));
                if (soundwaveGame != null)
                {
                    InteractiveGameVersionModel soundwaveGameVersion = await ChannelSession.Connection.GetInteractiveGameVersion(soundwaveGame.versions.First());

                    InteractiveSceneModel soundwaveGameScene = soundwaveGameVersion.controls.scenes.First();

                    foreach (string profile in this.soundwaveProfiles.Where(p => p.AddProfile).Select(p => p.Name))
                    {
                        // Add code logic to create Interactive Game on Mixer that is a copy of the Soundwave Interactive game, but with buttons filed in with name and not disabled
                        InteractiveSceneModel       profileScene = InteractiveGameHelper.CreateDefaultScene();
                        InteractiveGameListingModel profileGame  = await ChannelSession.Connection.CreateInteractiveGame(ChannelSession.Channel, ChannelSession.User, profile, profileScene);

                        InteractiveGameVersionModel gameVersion = profileGame.versions.FirstOrDefault();
                        if (gameVersion != null)
                        {
                            InteractiveGameVersionModel profileGameVersion = await ChannelSession.Connection.GetInteractiveGameVersion(gameVersion);

                            if (profileGameVersion != null)
                            {
                                profileScene = profileGameVersion.controls.scenes.First();

                                for (int i = 0; i < this.soundwaveData.Profiles[profile].Count(); i++)
                                {
                                    SoundwaveButton soundwaveButton = this.soundwaveData.Profiles[profile][i];
                                    InteractiveButtonControlModel soundwaveControl = (InteractiveButtonControlModel)soundwaveGameScene.allControls.FirstOrDefault(c => c.controlID.Equals(i.ToString()));

                                    InteractiveButtonControlModel button = InteractiveGameHelper.CreateButton(soundwaveButton.name, soundwaveButton.name, soundwaveButton.sparks);
                                    button.position = soundwaveControl.position;

                                    InteractiveCommand command = new InteractiveCommand(profileGame, profileScene, button, InteractiveButtonCommandTriggerType.MouseDown);
                                    command.IndividualCooldown = soundwaveButton.cooldown;
                                    if (this.soundwaveData.StaticCooldown)
                                    {
                                        command.CooldownGroup = SoundwaveInteractiveCooldownGroupName;
                                    }

                                    SoundAction action = new SoundAction(soundwaveButton.path, soundwaveButton.volume);
                                    command.Actions.Add(action);

                                    ChannelSession.Settings.InteractiveCommands.Add(command);
                                    profileScene.buttons.Add(button);
                                }

                                await ChannelSession.Connection.UpdateInteractiveGameVersion(profileGameVersion);
                            }
                        }
                    }
                }
            }

            await ChannelSession.SaveSettings();
        }
Esempio n. 19
0
 public InteractiveTextBoxCommand(InteractiveGameModel game, InteractiveSceneModel scene, InteractiveTextBoxControlModel control, RequirementViewModel requirements)
     : base(game, scene, control, string.Empty, requirements)
 {
 }
Esempio n. 20
0
 public InteractiveJoystickCommand(InteractiveGameModel game, InteractiveSceneModel scene, InteractiveJoystickControlModel control, RequirementViewModel requirements)
     : base(game, scene, control, string.Empty, requirements)
 {
     this.MappedKeys = new List <InputKeyEnum?>();
 }
Esempio n. 21
0
 public InteractiveButtonCommand(InteractiveGameModel game, InteractiveSceneModel scene, InteractiveButtonControlModel control, InteractiveButtonCommandTriggerType eventType, RequirementViewModel requirements)
     : base(game, scene, control, EnumHelper.GetEnumName(eventType), requirements)
 {
     this.Trigger = eventType;
 }
Esempio n. 22
0
        private async Task <bool> Initialize()
        {
            this.Scenes.Clear();
            this.Controls.Clear();

            InteractiveGameVersionModel gameVersion = await ChannelSession.Connection.GetInteractiveGameVersion(this.Game.versions.OrderByDescending(v => v.createdAt.GetValueOrDefault()).First());

            foreach (InteractiveSceneModel scene in gameVersion.controls.scenes)
            {
                await this.UpdateControls(new InteractiveConnectedSceneModel()
                {
                    sceneID = scene.sceneID
                }, scene.allControls);
            }

            // Initialize Scenes
            InteractiveConnectedSceneGroupCollectionModel scenes = await ChannelSession.Interactive.GetScenes();

            if (scenes == null)
            {
                return(false);
            }

            foreach (InteractiveConnectedSceneModel scene in scenes.scenes)
            {
                this.Scenes.Add(scene);

                InteractiveSceneModel dataScene = gameVersion.controls.scenes.FirstOrDefault(s => s.sceneID.Equals(scene.sceneID));

                foreach (InteractiveConnectedButtonControlModel button in scene.buttons)
                {
                    if (dataScene != null)
                    {
                        InteractiveButtonControlModel dataButton = dataScene.buttons.FirstOrDefault(b => b.controlID.Equals(button.controlID));
                        if (dataButton != null)
                        {
                            button.text    = dataButton.text;
                            button.tooltip = dataButton.tooltip;
                        }
                    }

                    this.AddConnectedControl(scene, button);
                }

                foreach (InteractiveConnectedJoystickControlModel joystick in scene.joysticks)
                {
                    this.AddConnectedControl(scene, joystick);
                }

                foreach (InteractiveConnectedTextBoxControlModel textBox in scene.textBoxes)
                {
                    if (dataScene != null)
                    {
                        InteractiveTextBoxControlModel dataTextBox = dataScene.textBoxes.FirstOrDefault(b => b.controlID.Equals(textBox.controlID));
                        if (dataTextBox != null)
                        {
                            textBox.placeholder = dataTextBox.placeholder;
                            textBox.submitText  = dataTextBox.submitText;
                        }
                    }

                    this.AddConnectedControl(scene, textBox);
                }
            }

            // Initialize Groups
            List <InteractiveGroupModel> groupsToAdd = new List <InteractiveGroupModel>();

            if (ChannelSession.Settings.InteractiveUserGroups.ContainsKey(this.Client.InteractiveGame.id))
            {
                foreach (InteractiveUserGroupViewModel userGroup in ChannelSession.Settings.InteractiveUserGroups[this.Client.InteractiveGame.id])
                {
                    if (!userGroup.DefaultScene.Equals(InteractiveUserGroupViewModel.DefaultName))
                    {
                        if (!await this.AddGroup(userGroup.GroupName, userGroup.DefaultScene))
                        {
                            return(false);
                        }
                    }
                }
            }

            // Initialize Participants
            await this.AddParticipants(await this.GetRecentParticipants());

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            Task.Run(async() => { await this.RefreshInteractiveUsers(); }, this.backgroundThreadCancellationTokenSource.Token);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

            return(true);
        }
Esempio n. 23
0
        private async Task FinalizeNewUser()
        {
            if (this.scorpBotData != null)
            {
                // Import Ranks
                int    rankEnabled   = this.scorpBotData.GetIntSettingsValue("currency", "enabled");
                string rankName      = this.scorpBotData.GetSettingsValue("currency", "name", "Rank");
                int    rankInterval  = this.scorpBotData.GetIntSettingsValue("currency", "onlinepayinterval");
                int    rankAmount    = this.scorpBotData.GetIntSettingsValue("currency", "activeuserbonus");
                int    rankMaxAmount = this.scorpBotData.GetIntSettingsValue("currency", "maxlimit");
                if (rankMaxAmount <= 0)
                {
                    rankMaxAmount = int.MaxValue;
                }
                int    rankOnFollowBonus    = this.scorpBotData.GetIntSettingsValue("currency", "onfollowbonus");
                int    rankOnSubBonus       = this.scorpBotData.GetIntSettingsValue("currency", "onsubbonus");
                int    rankSubBonus         = this.scorpBotData.GetIntSettingsValue("currency", "subbonus");
                string rankCommand          = this.scorpBotData.GetSettingsValue("currency", "command", "");
                string rankCommandResponse  = this.scorpBotData.GetSettingsValue("currency", "response", "");
                string rankUpCommand        = this.scorpBotData.GetSettingsValue("currency", "Currency1RankUpMsg", "");
                int    rankAccumulationType = this.scorpBotData.GetIntSettingsValue("currency", "ranksrectype");

                UserCurrencyViewModel rankCurrency       = null;
                UserCurrencyViewModel rankPointsCurrency = null;
                if (!string.IsNullOrEmpty(rankName))
                {
                    if (rankAccumulationType == 1)
                    {
                        rankCurrency = new UserCurrencyViewModel()
                        {
                            Name = rankName.Equals("Points") ? "Hours" : rankName,
                            SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(rankName.Equals("Points") ? "Hours" : rankName),
                            AcquireInterval   = 60,
                            AcquireAmount     = 1,
                            MaxAmount         = rankMaxAmount,
                        };

                        if (rankInterval >= 0 && rankAmount >= 0)
                        {
                            rankPointsCurrency = new UserCurrencyViewModel()
                            {
                                Name = "Points",
                                SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier("points"),
                                AcquireInterval   = rankInterval,
                                AcquireAmount     = rankAmount,
                                MaxAmount         = rankMaxAmount,
                                OnFollowBonus     = rankOnFollowBonus,
                                OnSubscribeBonus  = rankOnSubBonus,
                                SubscriberBonus   = rankSubBonus,
                                ModeratorBonus    = rankSubBonus
                            };

                            ChannelSession.Settings.Currencies[rankPointsCurrency.ID] = rankPointsCurrency;
                        }
                    }
                    else if (rankInterval >= 0 && rankAmount >= 0)
                    {
                        rankCurrency = new UserCurrencyViewModel()
                        {
                            Name = rankName,
                            SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(rankName),
                            AcquireInterval   = rankInterval,
                            AcquireAmount     = rankAmount,
                            MaxAmount         = rankMaxAmount,
                            OnFollowBonus     = rankOnFollowBonus,
                            OnSubscribeBonus  = rankOnSubBonus,
                            SubscriberBonus   = rankSubBonus,
                            ModeratorBonus    = rankSubBonus
                        };
                    }
                }

                // Import Currency
                int    currencyEnabled   = this.scorpBotData.GetIntSettingsValue("currency2", "enabled");
                string currencyName      = this.scorpBotData.GetSettingsValue("currency2", "name", "Currency");
                int    currencyInterval  = this.scorpBotData.GetIntSettingsValue("currency2", "onlinepayinterval");
                int    currencyAmount    = this.scorpBotData.GetIntSettingsValue("currency2", "activeuserbonus");
                int    currencyMaxAmount = this.scorpBotData.GetIntSettingsValue("currency2", "maxlimit");
                if (currencyMaxAmount <= 0)
                {
                    currencyMaxAmount = int.MaxValue;
                }
                int    currencyOnFollowBonus   = this.scorpBotData.GetIntSettingsValue("currency2", "onfollowbonus");
                int    currencyOnSubBonus      = this.scorpBotData.GetIntSettingsValue("currency2", "onsubbonus");
                int    currencySubBonus        = this.scorpBotData.GetIntSettingsValue("currency2", "subbonus");
                string currencyCommand         = this.scorpBotData.GetSettingsValue("currency2", "command", "");
                string currencyCommandResponse = this.scorpBotData.GetSettingsValue("currency2", "response", "");

                UserCurrencyViewModel currency = null;
                if (!string.IsNullOrEmpty(currencyName) && currencyInterval >= 0 && currencyAmount >= 0)
                {
                    currency = new UserCurrencyViewModel()
                    {
                        Name          = currencyName, SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier(currencyName), AcquireInterval = currencyInterval,
                        AcquireAmount = currencyAmount, MaxAmount = currencyMaxAmount, OnFollowBonus = currencyOnFollowBonus, OnSubscribeBonus = currencyOnSubBonus,
                    };
                    ChannelSession.Settings.Currencies[currency.ID] = currency;

                    if (!string.IsNullOrEmpty(currencyCommand) && !string.IsNullOrEmpty(currencyCommandResponse))
                    {
                        currencyCommandResponse = currencyCommandResponse.Replace("$points2", "$" + currency.UserAmountSpecialIdentifier);
                        currencyCommandResponse = currencyCommandResponse.Replace("$currencyname2", currency.Name);
                        this.scorpBotData.Commands.Add(new ScorpBotCommand(currencyCommand, currencyCommandResponse));
                    }
                }

                foreach (ScorpBotViewer viewer in this.scorpBotData.Viewers)
                {
                    ChannelSession.Settings.UserData[viewer.ID] = new UserDataViewModel(viewer);

                    if (rankPointsCurrency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(rankPointsCurrency, (int)viewer.RankPoints);
                    }

                    if (rankCurrency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(rankCurrency, (rankPointsCurrency != null) ? (int)viewer.Hours : (int)viewer.RankPoints);
                    }

                    if (currency != null)
                    {
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(currency, (int)viewer.Currency);
                    }
                }

                if (rankCurrency != null)
                {
                    ChannelSession.Settings.Currencies[rankCurrency.ID] = rankCurrency;

                    foreach (ScorpBotRank rank in this.scorpBotData.Ranks)
                    {
                        rankCurrency.Ranks.Add(new UserRankViewModel(rank.Name, rank.Amount));
                    }

                    if (!string.IsNullOrEmpty(rankCommand) && !string.IsNullOrEmpty(rankCommandResponse))
                    {
                        rankCommandResponse = rankCommandResponse.Replace(" / Raids: $raids", "");
                        rankCommandResponse = rankCommandResponse.Replace("$rank", "$" + rankCurrency.UserRankNameSpecialIdentifier);
                        rankCommandResponse = rankCommandResponse.Replace("$points", "$" + rankCurrency.UserAmountSpecialIdentifier);
                        rankCommandResponse = rankCommandResponse.Replace("$currencyname", rankCurrency.Name);
                        this.scorpBotData.Commands.Add(new ScorpBotCommand(rankCommand, rankCommandResponse));
                    }

                    if (!string.IsNullOrEmpty(rankUpCommand))
                    {
                        rankUpCommand = rankUpCommand.Replace("$rank", "$" + rankCurrency.UserRankNameSpecialIdentifier);
                        rankUpCommand = rankUpCommand.Replace("$points", "$" + rankCurrency.UserAmountSpecialIdentifier);
                        rankUpCommand = rankUpCommand.Replace("$currencyname", rankCurrency.Name);

                        ScorpBotCommand scorpCommand = new ScorpBotCommand("rankup", rankUpCommand);
                        ChatCommand     chatCommand  = new ChatCommand(scorpCommand);

                        rankCurrency.RankChangedCommand = new CustomCommand("User Rank Changed");
                        rankCurrency.RankChangedCommand.Actions.AddRange(chatCommand.Actions);
                    }
                }

                foreach (ScorpBotCommand command in this.scorpBotData.Commands)
                {
                    command.ProcessData(currency, rankCurrency);
                    ChannelSession.Settings.ChatCommands.Add(new ChatCommand(command));
                }

                foreach (ScorpBotTimer timer in this.scorpBotData.Timers)
                {
                    ChannelSession.Settings.TimerCommands.Add(new TimerCommand(timer));
                }

                foreach (string quote in this.scorpBotData.Quotes)
                {
                    ChannelSession.Settings.UserQuotes.Add(new UserQuoteViewModel(quote));
                }

                if (ChannelSession.Settings.UserQuotes.Count > 0)
                {
                    ChannelSession.Settings.QuotesEnabled = true;
                }

                if (this.scorpBotData.GetBoolSettingsValue("settings", "filtwordsen"))
                {
                    foreach (string filteredWord in this.scorpBotData.FilteredWords)
                    {
                        ChannelSession.Settings.FilteredWords.Add(filteredWord);
                    }
                    ChannelSession.Settings.ModerationFilteredWordsExcempt = this.scorpBotData.GetUserRoleSettingsValue("settings", "FilteredWordsPerm");
                }

                if (this.scorpBotData.GetBoolSettingsValue("settings", "chatcapschecknowarnregs"))
                {
                    ChannelSession.Settings.ModerationChatTextExcempt = MixerRoleEnum.User;
                }
                else if (this.scorpBotData.GetBoolSettingsValue("settings", "chatcapschecknowarnsubs"))
                {
                    ChannelSession.Settings.ModerationChatTextExcempt = MixerRoleEnum.Subscriber;
                }
                else if (this.scorpBotData.GetBoolSettingsValue("settings", "chatcapschecknowarnmods"))
                {
                    ChannelSession.Settings.ModerationChatTextExcempt = MixerRoleEnum.Mod;
                }
                else
                {
                    ChannelSession.Settings.ModerationChatTextExcempt = MixerRoleEnum.Streamer;
                }

                ChannelSession.Settings.ModerationCapsBlockIsPercentage = !this.scorpBotData.GetBoolSettingsValue("settings", "chatcapsfiltertype");
                if (ChannelSession.Settings.ModerationCapsBlockIsPercentage)
                {
                    ChannelSession.Settings.ModerationCapsBlockCount = this.scorpBotData.GetIntSettingsValue("settings", "chatperccaps");
                }
                else
                {
                    ChannelSession.Settings.ModerationCapsBlockCount = this.scorpBotData.GetIntSettingsValue("settings", "chatmincaps");
                }

                ChannelSession.Settings.ModerationBlockLinks        = this.scorpBotData.GetBoolSettingsValue("settings", "chatlinkalertsdel");
                ChannelSession.Settings.ModerationBlockLinksExcempt = this.scorpBotData.GetUserRoleSettingsValue("settings", "chatlinkalertsdelperm");
            }

            if (this.streamlabsChatBotData != null)
            {
                UserCurrencyViewModel rank = new UserCurrencyViewModel()
                {
                    Name = "Rank",
                    SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier("rank"),
                    AcquireInterval   = 60,
                    AcquireAmount     = 1
                };

                foreach (StreamlabsChatBotRank slrank in this.streamlabsChatBotData.Ranks)
                {
                    rank.Ranks.Add(new UserRankViewModel(slrank.Name, slrank.Requirement));
                }

                UserCurrencyViewModel currency = new UserCurrencyViewModel()
                {
                    Name = "Points",
                    SpecialIdentifier = SpecialIdentifierStringBuilder.ConvertToSpecialIdentifier("points"),
                    AcquireInterval   = 1,
                    AcquireAmount     = 1
                };

                ChannelSession.Settings.Currencies[rank.ID]     = rank;
                ChannelSession.Settings.Currencies[currency.ID] = currency;

                this.AddCurrencyRankCommands(rank);
                this.AddCurrencyRankCommands(currency);

                foreach (StreamlabsChatBotViewer viewer in this.streamlabsChatBotData.Viewers)
                {
                    UserModel user = await ChannelSession.Connection.GetUser(viewer.Name);

                    if (user != null)
                    {
                        viewer.ID = user.id;
                        ChannelSession.Settings.UserData[viewer.ID] = new UserDataViewModel(viewer);
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(rank, viewer.Hours);
                        ChannelSession.Settings.UserData[viewer.ID].SetCurrencyAmount(currency, viewer.Points);
                    }
                }

                foreach (StreamlabsChatBotCommand command in this.streamlabsChatBotData.Commands)
                {
                    command.ProcessData(currency, rank);
                    ChannelSession.Settings.ChatCommands.Add(new ChatCommand(command));
                }

                foreach (StreamlabsChatBotTimer timer in this.streamlabsChatBotData.Timers)
                {
                    StreamlabsChatBotCommand command = new StreamlabsChatBotCommand()
                    {
                        Command = timer.Name, Response = timer.Response, Enabled = timer.Enabled
                    };
                    command.ProcessData(currency, rank);
                    ChannelSession.Settings.ChatCommands.Add(new ChatCommand(command));

                    timer.Actions = command.Actions;

                    ChannelSession.Settings.TimerCommands.Add(new TimerCommand(timer));
                }

                foreach (string quote in this.streamlabsChatBotData.Quotes)
                {
                    ChannelSession.Settings.UserQuotes.Add(new UserQuoteViewModel(quote));
                }

                if (ChannelSession.Settings.UserQuotes.Count > 0)
                {
                    ChannelSession.Settings.QuotesEnabled = true;
                }
            }

            if (this.soundwaveData != null && this.soundwaveProfiles != null && this.soundwaveProfiles.Count(p => p.AddProfile) > 0)
            {
                if (this.soundwaveData.StaticCooldown)
                {
                    ChannelSession.Settings.CooldownGroups[SoundwaveInteractiveCooldownGroupName] = this.soundwaveData.StaticCooldownAmount / 1000;
                }

                InteractiveGameListingModel soundwaveGame = this.interactiveGames.FirstOrDefault(g => g.name.Equals(SoundwaveInteractiveGameName));
                if (soundwaveGame != null)
                {
                    InteractiveGameVersionModel version = soundwaveGame.versions.FirstOrDefault();
                    if (version != null)
                    {
                        InteractiveGameVersionModel soundwaveGameVersion = await ChannelSession.Connection.GetInteractiveGameVersion(version);

                        if (soundwaveGameVersion != null)
                        {
                            InteractiveSceneModel soundwaveGameScene = soundwaveGameVersion.controls.scenes.FirstOrDefault();
                            if (soundwaveGameScene != null)
                            {
                                foreach (string profile in this.soundwaveProfiles.Where(p => p.AddProfile).Select(p => p.Name))
                                {
                                    // Add code logic to create Interactive Game on Mixer that is a copy of the Soundwave Interactive game, but with buttons filed in with name and not disabled
                                    InteractiveSceneModel       profileScene = InteractiveGameHelper.CreateDefaultScene();
                                    InteractiveGameListingModel profileGame  = await ChannelSession.Connection.CreateInteractiveGame(ChannelSession.Channel, ChannelSession.User, profile, profileScene);

                                    InteractiveGameVersionModel gameVersion = profileGame.versions.FirstOrDefault();
                                    if (gameVersion != null)
                                    {
                                        InteractiveGameVersionModel profileGameVersion = await ChannelSession.Connection.GetInteractiveGameVersion(gameVersion);

                                        if (profileGameVersion != null)
                                        {
                                            profileScene = profileGameVersion.controls.scenes.First();

                                            for (int i = 0; i < this.soundwaveData.Profiles[profile].Count(); i++)
                                            {
                                                SoundwaveButton soundwaveButton = this.soundwaveData.Profiles[profile][i];
                                                InteractiveButtonControlModel soundwaveControl = (InteractiveButtonControlModel)soundwaveGameScene.allControls.FirstOrDefault(c => c.controlID.Equals(i.ToString()));

                                                InteractiveButtonControlModel button = InteractiveGameHelper.CreateButton(soundwaveButton.name, soundwaveButton.name, soundwaveButton.sparks);
                                                button.position = soundwaveControl.position;

                                                RequirementViewModel requirements = new RequirementViewModel();
                                                requirements.Cooldown.Amount = soundwaveButton.cooldown;
                                                if (this.soundwaveData.StaticCooldown)
                                                {
                                                    requirements.Cooldown.Type      = CooldownTypeEnum.Group;
                                                    requirements.Cooldown.GroupName = SoundwaveInteractiveCooldownGroupName;
                                                }
                                                InteractiveButtonCommand command = new InteractiveButtonCommand(profileGame, profileScene, button, InteractiveButtonCommandTriggerType.MouseDown, requirements);

                                                SoundAction action = new SoundAction(soundwaveButton.path, soundwaveButton.volume);
                                                command.Actions.Add(action);

                                                ChannelSession.Settings.InteractiveCommands.Add(command);
                                                profileScene.buttons.Add(button);
                                            }

                                            await ChannelSession.Connection.UpdateInteractiveGameVersion(profileGameVersion);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            await ChannelSession.SaveSettings();
        }
 public async Task <InteractiveGameListingModel> CreateInteractiveGame(ChannelModel channel, UserModel user, string name, InteractiveSceneModel defaultScene)
 {
     return(await this.RunAsync(InteractiveGameHelper.CreateInteractive2Game(this.Connection, channel, user, name, defaultScene)));
 }
Esempio n. 25
0
 public InteractiveButtonCommand(InteractiveGameModel game, InteractiveSceneModel scene, InteractiveButtonControlModel control, InteractiveButtonCommandTriggerType eventType, RequirementViewModel requirements)
     : this(game, scene, control, eventType, 0, requirements)
 {
 }