Exemple #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();
        }
Exemple #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
        }