public PUBGDropMapInteractiveControl(InteractiveGameModel game, InteractiveGameVersionModel version)
            : base(game, version)
        {
            InitializeComponent();

            this.Initialize(this.LocationPointsCanvas);

            this.MaxTimeTextBox.Text   = this.maxTime.ToString();
            this.SparkCostTextBox.Text = this.sparkCost.ToString();

            this.MapComboBox.ItemsSource = this.maps;

            this.maps.Add(new PUBGMap()
            {
                Name = ErangelMapName, Map = "map1.png"
            });
            this.maps.Add(new PUBGMap()
            {
                Name = MiramarMapName, Map = "map2.png"
            });
            this.maps.Add(new PUBGMap()
            {
                Name = SanhokMapName, Map = "map3.png"
            });

            this.MapComboBox.SelectedIndex = 0;

            JObject settings = this.GetCustomSettings();

            if (settings.ContainsKey(MapSelectionSettingProperty))
            {
                this.MapComboBox.SelectedIndex = settings[MapSelectionSettingProperty].ToObject <int>();
            }
        }
Exemplo n.º 2
0
 public void TrackInteractiveGame(InteractiveGameModel game)
 {
     this.TrySendEvent(() => this.telemetryClient.TrackEvent("InteractiveGame", new Dictionary <string, string> {
         { "Name", game.name }
     }));
     this.SendPlayFabEvent("InteractiveGame", "Name", game.name);
 }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 public static InteractiveAction CreateConnectAction(InteractiveGameModel game)
 {
     return(new InteractiveAction(InteractiveActionTypeEnum.Connect)
     {
         InteractiveGameID = game.id
     });
 }
        protected override async Task InitializeInternal()
        {
            List <InteractiveGameModel> interactiveGames = new List <InteractiveGameModel>();

            interactiveGames.Add(InteractiveSettingsControl.NoneInteractiveGame);
            interactiveGames.AddRange(await ChannelSession.Interactive.GetAllConnectableGames());
            this.DefaultInteractiveGameComboBox.ItemsSource = interactiveGames;

            InteractiveGameModel game = interactiveGames.FirstOrDefault(g => g.id.Equals(ChannelSession.Settings.DefaultInteractiveGame));

            if (game == null)
            {
                game = InteractiveSettingsControl.NoneInteractiveGame;
            }
            this.DefaultInteractiveGameComboBox.SelectedItem = game;

            this.PreventUnknownInteractiveUsersToggleButton.IsChecked = ChannelSession.Settings.PreventUnknownInteractiveUsers;

            this.CustomInteractiveProjectsListView.ItemsSource = this.customInteractiveProjects;
            this.customInteractiveProjects.Clear();
            foreach (InteractiveSharedProjectModel sharedProject in ChannelSession.Settings.CustomInteractiveProjectIDs)
            {
                this.customInteractiveProjects.Add(sharedProject);
            }

            await base.InitializeInternal();
        }
Exemplo n.º 7
0
 public static void InteractiveConnected(InteractiveGameModel game)
 {
     if (GlobalEvents.OnInteractiveConnected != null)
     {
         GlobalEvents.OnInteractiveConnected(null, game);
     }
 }
        public CustomInteractiveGameControl(InteractiveGameModel game, InteractiveGameVersionModel version)
        {
            this.Game    = game;
            this.Version = version;

            this.Loaded += CustomInteractiveGameControl_Loaded;
        }
        public void CreateGetUpdateDeleteGame()
        {
            TestWrapper(async(MixerConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetChannel(connection);

                InteractiveGameListingModel gameListing = await InteractiveServiceUnitTests.CreateTestGame(connection, channel);

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

                Assert.IsNotNull(games);
                Assert.IsTrue(games.Count() > 0);
                Assert.IsTrue(games.Any(g => g.id.Equals(gameListing.id)));

                string gameName           = gameListing.name = "Test Game";
                InteractiveGameModel game = await connection.Interactive.UpdateInteractiveGame(gameListing);

                Assert.IsNotNull(game);
                Assert.IsTrue(game.id > 0);
                Assert.AreEqual(game.name, gameName);

                await InteractiveServiceUnitTests.DeleteTestGame(connection, game);

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

                Assert.IsNotNull(games);
                Assert.IsFalse(games.Any(g => g.id.Equals(game.id)));
            });
        }
 private void DefaultInteractiveGameComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (this.DefaultInteractiveGameComboBox.SelectedIndex >= 0)
     {
         InteractiveGameModel game = (InteractiveGameModel)this.DefaultInteractiveGameComboBox.SelectedItem;
         ChannelSession.Settings.DefaultInteractiveGame = game.id;
     }
 }
 private async void InteractiveGamesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.InteractiveGamesComboBox.SelectedIndex >= 0)
     {
         this.selectedGame = (InteractiveGameModel)this.InteractiveGamesComboBox.SelectedItem;
         await this.RefreshSelectedGame();
     }
 }
 private void GlobalEvents_OnInteractiveConnected(object sender, InteractiveGameModel game)
 {
     this.Dispatcher.InvokeAsync(() =>
     {
         this.InteractiveGamesComboBox.SelectedItem = this.interactiveGames.FirstOrDefault(g => g.id.Equals(game.id));
         return(Task.FromResult(0));
     });
 }
 public void TrackInteractiveGame(InteractiveGameModel game)
 {
     if (!ChannelSession.Settings.OptOutTracking)
     {
         this.telemetryClient.TrackEvent("InteractiveGame", new Dictionary <string, string> {
             { "Name", game.name }
         });
     }
 }
Exemplo n.º 14
0
        public BasicInteractiveButtonCommandEditorControl(CommandWindow window, InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveButtonCommand command)
        {
            this.window  = window;
            this.game    = game;
            this.version = version;
            this.command = command;

            InitializeComponent();
        }
        public InteractiveButtonCommandDetailsControl(InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveSceneModel scene, InteractiveButtonControlModel control)
        {
            this.Game    = game;
            this.Version = version;
            this.Scene   = scene;
            this.Control = control;

            InitializeComponent();
        }
        public InteractiveButtonCommandDetailsControl(InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveButtonCommand command)
        {
            this.Game    = game;
            this.Version = version;
            this.command = command;
            this.Control = command.Button;

            InitializeComponent();
        }
        public BlackOps4DropMapInteractiveControl(InteractiveGameModel game, InteractiveGameVersionModel version)
            : base(game, version)
        {
            InitializeComponent();

            this.Initialize(this.LocationPointsCanvas);

            this.MaxTimeTextBox.Text   = this.maxTime.ToString();
            this.SparkCostTextBox.Text = this.sparkCost.ToString();
        }
        public InteractiveSceneUserGroupsDialogControl(InteractiveGameModel game, InteractiveSceneModel scene)
        {
            this.game  = game;
            this.scene = scene;

            InitializeComponent();

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

            this.Loaded += InteractiveSceneUserGroupsDialogControl_Loaded;
        }
Exemplo n.º 19
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();
        }
Exemplo n.º 20
0
        public async Task <bool> Connect(InteractiveGameModel game, InteractiveGameVersionModel version)
        {
            this.Game    = game;
            this.Version = version;

            this.Scenes.Clear();
            this.Controls.Clear();
            this.ControlCommands.Clear();
            this.Participants.Clear();

            return(await this.AttemptConnect());
        }
Exemplo n.º 21
0
        private InteractiveClient(ChannelModel channel, InteractiveGameModel interactiveGame, InteractiveGameVersionModel version, string shareCode, OAuthTokenModel authToken, IEnumerable <string> interactiveConnections)
        {
            Validator.ValidateVariable(channel, "channel");
            Validator.ValidateVariable(interactiveGame, "interactiveGame");
            Validator.ValidateVariable(version, "version");
            Validator.ValidateVariable(authToken, "authToken");
            Validator.ValidateList(interactiveConnections, "interactiveConnections");

            this.Channel                = channel;
            this.InteractiveGame        = interactiveGame;
            this.Version                = version;
            this.ShareCode              = shareCode;
            this.interactiveConnections = interactiveConnections;

            this.oauthAccessToken = authToken.accessToken;
        }
        protected override async Task InitializeInternal()
        {
            this.InteractiveGamesComboBox.ItemsSource    = this.interactiveGames;
            this.InteractiveScenesComboBox.ItemsSource   = this.interactiveScenes;
            this.InteractiveControlsGridView.ItemsSource = this.currentSceneControlItems;

            await this.RefreshAllInteractiveGames();

            if (ChannelSession.Settings.DefaultInteractiveGame > 0)
            {
                InteractiveGameModel game = this.interactiveGames.FirstOrDefault(g => g.id.Equals(ChannelSession.Settings.DefaultInteractiveGame));
                if (game != null)
                {
                    this.InteractiveGamesComboBox.SelectedItem = game;
                }
            }
        }
Exemplo n.º 23
0
        public async Task <IEnumerable <InteractiveGameModel> > GetAllConnectableGames(bool forceRefresh = false)
        {
            if (forceRefresh || this.lastRefresh < DateTimeOffset.Now)
            {
                this.lastRefresh = DateTimeOffset.Now.AddMinutes(1);
                this.games.Clear();

                this.games.AddRange(await ChannelSession.Connection.GetOwnedInteractiveGames(ChannelSession.Channel));
                games.RemoveAll(g => g.name.Equals("Soundwave Interactive Soundboard"));

                foreach (InteractiveSharedProjectModel project in ChannelSession.Settings.CustomInteractiveProjectIDs)
                {
                    InteractiveGameVersionModel version = await ChannelSession.Connection.GetInteractiveGameVersion(project.VersionID);

                    if (version != null)
                    {
                        InteractiveGameModel game = await ChannelSession.Connection.GetInteractiveGame(version.gameId);

                        if (game != null)
                        {
                            games.Add(game);
                        }
                    }
                }

                foreach (InteractiveSharedProjectModel project in InteractiveSharedProjectModel.AllMixPlayProjects)
                {
                    InteractiveGameVersionModel version = await ChannelSession.Connection.GetInteractiveGameVersion(project.VersionID);

                    if (version != null)
                    {
                        InteractiveGameModel game = await ChannelSession.Connection.GetInteractiveGame(version.gameId);

                        if (game != null)
                        {
                            game.name += " (MixPlay)";
                            games.Add(game);
                        }
                    }
                }
            }

            return(games);
        }
        public async Task <IEnumerable <InteractiveGameModel> > GetAllConnectableGames()
        {
            List <InteractiveGameModel> games = new List <InteractiveGameModel>();

            games.AddRange(await ChannelSession.Connection.GetOwnedInteractiveGames(ChannelSession.Channel));
            games.RemoveAll(g => g.name.Equals("Soundwave Interactive Soundboard"));

            foreach (InteractiveSharedProjectModel project in ChannelSession.Settings.CustomInteractiveProjectIDs)
            {
                InteractiveGameVersionModel version = await ChannelSession.Connection.GetInteractiveGameVersion(project.VersionID);

                if (version != null)
                {
                    InteractiveGameModel game = await ChannelSession.Connection.GetInteractiveGame(version.gameId);

                    if (game != null)
                    {
                        games.Add(game);
                    }
                }
            }

            foreach (InteractiveSharedProjectModel project in InteractiveSharedProjectModel.AllMixPlayProjects)
            {
                InteractiveGameVersionModel version = await ChannelSession.Connection.GetInteractiveGameVersion(project.VersionID);

                if (version != null)
                {
                    InteractiveGameModel game = await ChannelSession.Connection.GetInteractiveGame(version.gameId);

                    if (game != null)
                    {
                        game.name += " (MixPlay)";
                        games.Add(game);
                    }
                }
            }

            return(games);
        }
Exemplo n.º 25
0
        public DropMapInteractiveControl(DropMapTypeEnum dropMapType, InteractiveGameModel game, InteractiveGameVersionModel version)
            : base(game, version)
        {
            InitializeComponent();

            this.MapComboBox.ItemsSource = this.maps;

            this.maps.Add(new PUBGMap()
            {
                Name = ErangelMapName, Map = "map1.png"
            });
            this.maps.Add(new PUBGMap()
            {
                Name = MiramarMapName, Map = "map2.png"
            });
            this.maps.Add(new PUBGMap()
            {
                Name = SanhokMapName, Map = "map3.png"
            });
            this.maps.Add(new PUBGMap()
            {
                Name = VikendiMapName, Map = "map4.png"
            });

            this.dropMapType = dropMapType;

            JObject settings = this.GetCustomSettings();

            if (settings.ContainsKey(MaxTimeSettingProperty))
            {
                this.maxTime = settings[MaxTimeSettingProperty].ToObject <int>();
            }
            if (settings.ContainsKey(SparkCostSettingProperty))
            {
                this.sparkCost = settings[SparkCostSettingProperty].ToObject <int>();
            }

            this.MapImage.SizeChanged += MapImage_SizeChanged;
        }
        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);
        }
Exemplo n.º 27
0
        /// <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));
        }
 public static async Task DeleteTestGame(MixerConnection connection, InteractiveGameModel game)
 {
     Assert.IsTrue(await connection.Interactive.DeleteInteractiveGame(game));
 }
 public MixerPaintInteractiveControl(InteractiveGameModel game, InteractiveGameVersionModel version)
     : base(game, version)
 {
     InitializeComponent();
 }
Exemplo n.º 30
0
        public async Task <bool> Connect(InteractiveGameModel game)
        {
            IEnumerable <InteractiveGameVersionModel> versions = await ChannelSession.Connection.GetInteractiveGameVersions(game);

            return(await this.Connect(game, versions.First()));
        }