public CarrierCommandGame(Guid id, GameSettingsController settingsController)
     : base(
         id,
         new CarrierCommandSettings(id, new CarrierCommandStartupParmeters(DefaultStartupParameters),
                                    settingsController))
 {
 }
Esempio n. 2
0
 public Homeworld2Game(Guid id, GameSettingsController settingsController)
     : this(
         id,
         new Homeworld2Settings(id, new Homeworld2StartupParameters(DefaultStartupParameters), settingsController)
         )
 {
 }
Esempio n. 3
0
 public Arma2CoSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller,
                        ArmaSettings arma2Settings, Arma2FreeSettings arma2FreeSettings)
     : base(gameId, startupParameters, controller)
 {
     Arma2Original = arma2Settings;
     Arma2Free     = arma2FreeSettings;
 }
Esempio n. 4
0
 public Arma2COGame(Guid id, GameSettingsController settingsController, Arma2Game arma2Game,
     Arma2FreeGame arma2FreeGame)
     : this(
         id,
         new Arma2CoSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController,
             arma2Game.Settings, arma2FreeGame.Settings)) {
     _arma2FreeGame = arma2FreeGame;
     _arma2Game = arma2Game;
 }
Esempio n. 5
0
 public Arma2FreeSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller)
 {
     StartupParameters = startupParameters;
     if (ServerFilter == null)
     {
         ServerFilter = new ArmaServerFilter();
     }
 }
Esempio n. 6
0
 public Arma2COGame(Guid id, GameSettingsController settingsController, Arma2Game arma2Game,
                    Arma2FreeGame arma2FreeGame)
     : this(
         id,
         new Arma2CoSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController,
                             arma2Game.Settings, arma2FreeGame.Settings))
 {
     _arma2FreeGame = arma2FreeGame;
     _arma2Game     = arma2Game;
 }
        public void SetUp() {
            var gsc = new GameSettingsController();

            _gameo = new Arma2Game(Guid.NewGuid(), gsc);
            _settingso = _gameo.Settings;
            _settingso.Directory = @"C:\temp".ToAbsoluteDirectoryPath();

            _game = new Arma2COGame(Guid.NewGuid(), gsc, _gameo, A.Fake<Arma2FreeGame>());
            _settings = _game.Settings;
            _settings.Directory = @"C:\temp".ToAbsoluteDirectoryPath();
        }
Esempio n. 8
0
        public void Controller_GameSettings_Read_No_Id_Should_Return_Default_Model()
        {
            // Arrange
            var controller = new GameSettingsController();

            // Act
            var result = controller.Read();

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);
        }
Esempio n. 9
0
        public void Controller_GameSettings_Instantiate_Default_Should_Pass()
        {
            // Arrange
            var controller = new GameSettingsController();

            // Act
            var result = controller.GetType();

            // Assert
            Assert.AreEqual(result, new GameSettingsController().GetType(), TestContext.TestName);
        }
Esempio n. 10
0
        public void Controller_GameSettings_Post_Update_Null_Data_Should_Return_Error()
        {
            // Arrange
            var controller = new GameSettingsController();

            // Act
            var result = (RedirectToRouteResult)controller.Update((GameModel)null);

            // Assert
            Assert.AreEqual("Error", result.RouteValues["action"], TestContext.TestName);
        }
Esempio n. 11
0
        public void SetUp()
        {
            var gsc = new GameSettingsController();

            _gameo               = new Arma2Game(Guid.NewGuid(), gsc);
            _settingso           = _gameo.Settings;
            _settingso.Directory = @"C:\temp".ToAbsoluteDirectoryPath();

            _game               = new Arma2COGame(Guid.NewGuid(), gsc, _gameo, A.Fake <Arma2FreeGame>());
            _settings           = _game.Settings;
            _settings.Directory = @"C:\temp".ToAbsoluteDirectoryPath();
        }
Esempio n. 12
0
        public void Controller_GameSettings_Read_Invalid_Id_Should_Return_Error_Page()
        {
            // Arrange
            var    controller = new GameSettingsController();
            string id         = "bogus";

            // Act
            var result = (RedirectToRouteResult)controller.Read(id);

            // Assert
            Assert.AreEqual("Error", result.RouteValues["action"], TestContext.TestName);
            Assert.AreEqual("Home", result.RouteValues["controller"], TestContext.TestName);
        }
Esempio n. 13
0
        public ArmaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
            : base(gameId, startupParameters, controller) {
            StartupParameters = startupParameters;
            if (ServerFilter == null)
                ServerFilter = new ArmaServerFilter();

            this.WhenAnyValue(x => x.ModDirectory)
                .Where(x => RepositoryDirectory == null && x != null)
                .Subscribe(x => { RepositoryDirectory = x; });

            this.WhenAnyValue(x => x.DefaultModDirectory)
                .Where(x => ModDirectory == null && x != null)
                .Subscribe(x => { ModDirectory = x; });
        }
Esempio n. 14
0
        public void Controller_GameSettings_Post_Update_Invalid_Model_Should_Send_Back_For_Edit()
        {
            // Arrange
            var controller = new GameSettingsController();
            var data       = new GameModel();

            // Make ModelState Invalid
            controller.ModelState.AddModelError("test", "test");

            // Act
            ViewResult result = (ViewResult)controller.Update(data);

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);
        }
Esempio n. 15
0
        public void Controller_GameSettings_Update_Get_Default_Should_Pass()
        {
            // Arrange
            var controller = new GameSettingsController();

            string id = DataSourceBackend.Instance.GameBackend.GetDefault().Id;

            // Act
            var result = (ViewResult)controller.Update(id);

            // Reset
            DataSourceBackend.Instance.Reset();

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);
        }
Esempio n. 16
0
        public void Controller_GameSettings_Post_Update_Empty_Id_Should_Send_Back_For_Edit()
        {
            // Arrange
            var       controller = new GameSettingsController();
            GameModel dataEmpty  = new GameModel
            {
                // Make data.Id empty
                Id = ""
            };

            // Act
            var resultEmpty = (ViewResult)controller.Update(dataEmpty);

            // Assert
            Assert.IsNotNull(resultEmpty, TestContext.TestName);
        }
Esempio n. 17
0
        public void Controller_GameSettings_Post_Update_Null_Id_Should_Send_Back_For_Edit()
        {
            // Arrange
            var       controller = new GameSettingsController();
            GameModel dataNull   = new GameModel
            {
                // Make data.Id = null
                Id = null
            };

            // Act
            var resultNull = (ViewResult)controller.Update(dataNull);

            // Assert
            Assert.IsNotNull(resultNull, TestContext.TestName);
        }
Esempio n. 18
0
        public ArmaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
            : base(gameId, startupParameters, controller)
        {
            StartupParameters = startupParameters;
            if (ServerFilter == null)
            {
                ServerFilter = new ArmaServerFilter();
            }

            this.WhenAnyValue(x => x.ModDirectory)
            .Where(x => RepositoryDirectory == null && x != null)
            .Subscribe(x => { RepositoryDirectory = x; });

            this.WhenAnyValue(x => x.DefaultModDirectory)
            .Where(x => ModDirectory == null && x != null)
            .Subscribe(x => { ModDirectory = x; });
        }
Esempio n. 19
0
        public void Controller_GameSettings_Post_Update_Default_Should_Return_Admin_Settings_Page()
        {
            // Arrange
            var controller = new GameSettingsController();

            // Get default GameModel
            GameModel GameModel = DataSourceBackend.Instance.GameBackend.GetDefault();

            // Act
            var result = (RedirectToRouteResult)controller.Update(GameModel);

            // Reset
            DataSourceBackend.Instance.Reset();

            // Assert
            Assert.AreEqual("Settings", result.RouteValues["action"], TestContext.TestName);
            Assert.AreEqual("Admin", result.RouteValues["controller"], TestContext.TestName);
        }
Esempio n. 20
0
        protected GameSettings(Guid gameId, GameStartupParameters sp, GameSettingsController controller)
        {
            _gameId           = gameId;
            _controller       = controller;
            StartupParameters = sp;

            controller.Register(gameId, this);

            if (StartupLine != null)
            {
                sp.Parse(StartupLine);
            }

            StartupParameters.WhenAnyValue(x => x.StartupLine)
            .Subscribe(x => StartupLine = x);

            this.WhenAnyValue(x => x.DefaultDirectory)
            .Where(x => Directory == null && x != null)
            .Subscribe(x => { Directory = x; });
        }
Esempio n. 21
0
        void OnDeserialized(StreamingContext context)
        {
            if (_gameSettings == null)
            {
                _gameSettings = new List <LegacyGameSettings>();
            }

            if (_gameSetSettings == null)
            {
                _gameSetSettings = new List <LegacyGameSetSettings>();
            }

            if (_gameSettingsController == null)
            {
                _gameSettingsController = new GameSettingsController();
            }
            if (_steamDirectory != null && !_steamDirectory.IsValidAbsoluteDirectoryPath())
            {
                _steamDirectory = null;
            }
        }
Esempio n. 22
0
 public DayZSettings(Guid gameId, DayZStartupParams sp, GameSettingsController controller)
     : base(gameId, sp, controller) {
     Filter = new ArmaServerFilter();
 }
 public Homeworld2Settings(Guid gameId, Homeworld2StartupParameters startupParameters,
     GameSettingsController controller) : base(gameId, startupParameters, controller) {
     StartupParameters = startupParameters;
 }
Esempio n. 24
0
 protected ArmaGame(Guid id, GameSettingsController settingsController)
     : this(id, new ArmaSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController)) {}
Esempio n. 25
0
 public GTAGameSettings(Guid gameId, GTAStartupParameters sp, GameSettingsController controller)
     : base(gameId, sp, controller)
 {
 }
Esempio n. 26
0
 public GTAGameSettings(Guid gameId, GTAStartupParameters sp, GameSettingsController controller)
     : base(gameId, sp, controller) {}
 protected RealVirtualitySettings(Guid gameId, RealVirtualityStartupParameters startupParameters,
     GameSettingsController controller)
     : base(gameId, startupParameters, controller) {
     StartupParameters = startupParameters;
 }
Esempio n. 28
0
 public Arma2OaGame(Guid id, GameSettingsController settingsController)
     : this(id, new Arma2OaSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController))
 {
 }
Esempio n. 29
0
 public Arma2OaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller)
 {
 }
Esempio n. 30
0
        void OnDeserialized(StreamingContext context) {
            if (_gameSettings == null)
                _gameSettings = new List<LegacyGameSettings>();

            if (_gameSetSettings == null)
                _gameSetSettings = new List<LegacyGameSetSettings>();

            if (_gameSettingsController == null)
                _gameSettingsController = new GameSettingsController();
        }
Esempio n. 31
0
 protected RealVirtualitySettings(Guid gameId, RealVirtualityStartupParameters startupParameters,
                                  GameSettingsController controller)
     : base(gameId, startupParameters, controller)
 {
     StartupParameters = startupParameters;
 }
 public CarrierCommandSettings(Guid gameId, CarrierCommandStartupParmeters sp, GameSettingsController controller)
     : base(gameId, sp, controller) {
     StartupParameters = sp;
 }
Esempio n. 33
0
        void OnDeserialized(StreamingContext context) {
            if (_gameSettings == null)
                _gameSettings = new List<LegacyGameSettings>();

            if (_gameSetSettings == null)
                _gameSetSettings = new List<LegacyGameSetSettings>();

            if (_gameSettingsController == null)
                _gameSettingsController = new GameSettingsController();
            if (_steamDirectory != null && !_steamDirectory.IsValidAbsoluteDirectoryPath())
                _steamDirectory = null;
        }
Esempio n. 34
0
 public Arma2FreeSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller) {
     StartupParameters = startupParameters;
     if (ServerFilter == null)
         ServerFilter = new ArmaServerFilter();
 }
Esempio n. 35
0
 public TakeOnMarsSettings(Guid gameId, TakeOnMarsStartupParams sp, GameSettingsController controller)
     : base(gameId, sp, controller) {
     StartupParameters = sp;
 }
Esempio n. 36
0
 public Arma1Game(Guid id, GameSettingsController settingsController) : base(id, settingsController) {}
Esempio n. 37
0
 public KerbalSPSettings(Guid gameId, KerbalSPStartupParameters sp, GameSettingsController controller)
     : base(gameId, sp, controller)
 {
     StartupParameters = sp;
 }
Esempio n. 38
0
 public KerbalSPGame(Guid id, GameSettingsController settingsController)
     : base(id, new KerbalSPSettings(id, new KerbalSPStartupParameters(), settingsController))
 {
 }
 public Arma2OaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller) {}
Esempio n. 40
0
 public Arma3Game(Guid id, GameSettingsController settingsController, AllInArmaGames aiaGames)
     : this(
         id, new Arma3Settings(id, new Arma3StartupParameters(DefaultStartupParameters), settingsController),
         aiaGames) {}
Esempio n. 41
0
        public GameContext(UserSettings settings)
        {
            _gameSettingsController = settings.GameOptions.GameSettingsController;
            _games = new Lazy <InMemoryDbSet <Game, Guid> >(CreateDbSet);
            _mods  = new Lazy <InMemoryDbSet <Mod, Guid> >(() => CreateDbSet(new ReactiveList <Mod>()));

            _localMissionsContainers = new Lazy <ReactiveList <LocalMissionsContainer> >(() => {
                var src = settings.MissionOptions.LocalMissions;
                lock (src) {
                    var source = new ReactiveList <LocalMissionsContainer>(src);
                    foreach (var lm in source)
                    {
                        lm.Game = Games.Find(lm.GameId);
                    }
                    source.KeepCollectionInSync(src);
                    return(source);
                }
            });

            _localModsContainers = new Lazy <ReactiveList <LocalModsContainer> >(() => {
                var src = settings.ModOptions.LocalMods;
                lock (src) {
                    var source = new ReactiveList <LocalModsContainer>(src);
                    foreach (var lm in source)
                    {
                        lm.Game = Games.Find(lm.GameId);
                    }
                    source.KeepCollectionInSync(src);
                    return(source);
                }
            });

            _customRepositories = new Lazy <ReactiveList <SixRepo> >(() => {
                var src = settings.ModOptions.Repositories;
                lock (src) {
                    var source = new ReactiveList <SixRepo>(src.Values);
                    source.TrackChanges(x => {
                        lock (src)
                            src[x.Uri.ToString()] = x;
                    },
                                        x => {
                        lock (src)
                            src.Remove(x.Uri.ToString());
                    },
                                        reset => {
                        lock (src) {
                            foreach (var r in reset)
                            {
                                src[r.Uri.ToString()] = r;
                            }
                            foreach (var r in src.Where(x => !reset.Contains(x.Value)))
                            {
                                src.Remove(r.Key);
                            }
                        }
                    });
                    //source.KeepCollectionInSync(settings.ModOptions.Repositories.Values);
                    return(source);
                }
            });

            _missions = new Lazy <InMemoryDbSet <Mission, Guid> >(
                () => {
                var set = CreateDbSet(new ReactiveList <Mission>());
                ProcessMissions(set);
                return(set);
            });

            _collections =
                new Lazy <InMemoryDbSet <Collection, Guid> >(
                    () => {
                var set = CreateDbSet(new ReactiveList <Collection>());
                ProcessCollections(set);
                return(set);
            });

            _customCollections =
                new Lazy <InMemoryDbSet <CustomCollection, Guid> >(
                    () => {
                var src = settings.ModOptions.CustomCollections;
                lock (src) {
                    var customCollectionsSource =
                        new ReactiveList <CustomCollection>(src);
                    customCollectionsSource.KeepCollectionInSync(src);
                    var set = CreateDbSet(customCollectionsSource);
                    ProcessCollections(set);
                    return(set);
                }
            });
            _subscribedCollections =
                new Lazy <InMemoryDbSet <SubscribedCollection, Guid> >(
                    () => {
                var src = settings.ModOptions.SubscribedCollections;
                lock (src) {
                    var subscribedCollectionsSource =
                        new ReactiveList <SubscribedCollection>(src);
                    subscribedCollectionsSource.KeepCollectionInSync(src);
                    var set = CreateDbSet(subscribedCollectionsSource);
                    ProcessCollections(set);
                    return(set);
                }
            });
        }
Esempio n. 42
0
 public Arma3Settings(Guid gameId, Arma3StartupParameters startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller) {
     StartupParameters = startupParameters;
 }
Esempio n. 43
0
 public Arma3Settings(Guid gameId, Arma3StartupParameters startupParameters, GameSettingsController controller)
     : base(gameId, startupParameters, controller)
 {
     StartupParameters = startupParameters;
 }
 public Arma2CoSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller,
     ArmaSettings arma2Settings, Arma2FreeSettings arma2FreeSettings)
     : base(gameId, startupParameters, controller) {
     Arma2Original = arma2Settings;
     Arma2Free = arma2FreeSettings;
 }
Esempio n. 45
0
 public Arma3Game(Guid id, GameSettingsController settingsController, AllInArmaGames aiaGames)
     : this(
         id, new Arma3Settings(id, new Arma3StartupParameters(DefaultStartupParameters), settingsController),
         aiaGames)
 {
 }
 public TakeOnHelicoptersGame(Guid id, GameSettingsController settingsController)
     : base(id, settingsController) {}
Esempio n. 47
0
 public GTAIVGame(Guid id, GameSettingsController settingsController)
     : base(id, new _Settings(id, new _StartupParameters(), settingsController))
 {
 }
Esempio n. 48
0
 public DayZGame(Guid id, GameSettingsController settingsController)
     : this(id, new DayZSettings(id, new DayZStartupParams(DefaultStartupParameters), settingsController)) {}
Esempio n. 49
0
 public GTAIVSettings(Guid gameId, _StartupParameters sp, GameSettingsController controller)
     : base(gameId, sp, controller)
 {
     StartupParameters = sp;
 }
Esempio n. 50
0
 public Arma2FreeGame(Guid id, GameSettingsController settingsController)
     : this(id, new Arma2FreeSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController)) {}
Esempio n. 51
0
 public Arma2Game(Guid id, GameSettingsController settingsController)
     : base(id, settingsController)
 {
 }