コード例 #1
0
        public override void Init()
        {
            IoCManager.Resolve <IConfigurationManager>().OverrideDefault(CVars.NetPredict, false);

            IComponentFactory componentFactory = IoCManager.Resolve <IComponentFactory>();

            componentFactory.DoAutoRegistrations();

            ClientContentIoC.Register();

            // This needs to happen after all IoC registrations, but before IoC.BuildGraph();
            foreach (var callback in TestingCallbacks)
            {
                var cast = (ClientModuleTestingCallbacks)callback;
                cast.ClientBeforeIoC?.Invoke();
            }

            IoCManager.BuildGraph();
            IoCManager.InjectDependencies(this);

            IoCManager.Resolve <DreamUserInterfaceStateManager>().Initialize();

            componentFactory.GenerateNetIds();

            _dreamResource.Initialize();

            // Load localization. Needed for some engine texts, such as the ones in Robust ViewVariables.
            IoCManager.Resolve <ILocalizationManager>().LoadCulture(new CultureInfo("en-US"));

            IoCManager.Resolve <IClyde>().SetWindowTitle("OpenDream");
            IoCManager.Resolve <IUserInterfaceManager>().Stylesheet = DreamStylesheet.Make();
        }
コード例 #2
0
        public override void Init()
        {
            IoCManager.Resolve <IStatusHost>().SetAczInfo(
                "Content.Client", new [] { "OpenDreamClient", "OpenDreamShared" });

            IComponentFactory componentFactory = IoCManager.Resolve <IComponentFactory>();

            componentFactory.DoAutoRegistrations();

            ServerContentIoC.Register();

            // This needs to happen after all IoC registrations, but before IoC.BuildGraph();
            foreach (var callback in TestingCallbacks)
            {
                var cast = (ServerModuleTestingCallbacks)callback;
                cast.ServerBeforeIoC?.Invoke();
            }

            IoCManager.BuildGraph();
            IoCManager.InjectDependencies(this);
            componentFactory.GenerateNetIds();

            var cfg = IoCManager.Resolve <IConfigurationManager>();

            cfg.OverrideDefault(CVars.NetLogLateMsg, false);      // Disable since disabling prediction causes timing errors otherwise.
            cfg.OverrideDefault(CVars.GameAutoPauseEmpty, false); // TODO: world.sleep_offline can control this
        }
コード例 #3
0
ファイル: DMTests.cs プロジェクト: redmoogle/OpenDream
        public void OneTimeSetup()
        {
            _taskManager = IoCManager.Resolve <ITaskManager>();
            _taskManager.Initialize();
            IComponentFactory componentFactory = IoCManager.Resolve <IComponentFactory>();

            componentFactory.RegisterClass <DMISpriteComponent>();
            componentFactory.GenerateNetIds();
            _dreamMan = IoCManager.Resolve <IDreamManager>();
            Compile(InitializeEnvironment);
            _dreamMan.Initialize(Path.ChangeExtension(InitializeEnvironment, "json"));
        }
コード例 #4
0
        public void Setup()
        {
            _components = IoCManager.Resolve <IComponentFactory>();
            _components.RegisterClass <HotReloadTestOneComponent>();
            _components.RegisterClass <HotReloadTestTwoComponent>();
            _components.GenerateNetIds();

            IoCManager.Resolve <ISerializationManager>().Initialize();
            _prototypes = (PrototypeManager)IoCManager.Resolve <IPrototypeManager>();
            _prototypes.RegisterType(typeof(EntityPrototype));
            _prototypes.LoadString(InitialPrototypes);
            _prototypes.Resync();

            _maps     = IoCManager.Resolve <IMapManager>();
            _entities = IoCManager.Resolve <IEntityManager>();
        }
コード例 #5
0
        public void Setup()
        {
            _componentFactory = IoCManager.Resolve <IComponentFactory>();

            _componentFactory.RegisterClass <ThrowsInAddComponent>();
            _componentFactory.RegisterClass <ThrowsInInitializeComponent>();
            _componentFactory.RegisterClass <ThrowsInStartupComponent>();
            _componentFactory.GenerateNetIds();

            EntityManager = IoCManager.Resolve <IServerEntityManager>();
            MapManager    = IoCManager.Resolve <IMapManager>();

            MapManager.CreateNewMapEntity(MapId.Nullspace);

            IoCManager.Resolve <ISerializationManager>().Initialize();
            var manager = IoCManager.Resolve <IPrototypeManager>();

            manager.LoadFromStream(new StringReader(PROTOTYPES));
            manager.Resync();

            //NOTE: The grids have not moved, so we can assert worldpos == localpos for the test
        }