protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            AspNetTimer.Start();

            ScriptService.Init();
            EmailHtmlLoader.Init();
        }
Exemplo n.º 2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ScriptService.Init();
        }
Exemplo n.º 3
0
            internal static void Start(object obj)
            {
                _queue = new ConcurrentWorkQueue <Action>(action => action());

                Game.Init();
                RunService.Init();
                SocialService.Init();
                HttpService.Init();
                ScriptService.Init();
                //AnalyticsService.Init();

                _resetter.Set();
                var stopwatch        = Stopwatch.StartNew();
                var physicsStopwatch = Stopwatch.StartNew();

                while (!CancelTokenSource.IsCancellationRequested)
                {
                    var step = stopwatch.Elapsed.TotalSeconds;
                    stopwatch.Restart();

                    // User Input
                    InputService.Step();

                    Game.FocusedCamera?.UpdateCamera(step);

                    // Network Replication
                    Game.NetworkServer?.Update(step);
                    Game.NetworkClient?.Update(step);

                    // wait() resume
                    ScriptService.ResumeWaitingScripts();

                    // Stepped
                    RunService.Update(step);
                    _queue.Work();

                    // Physics
                    var physicsStep = (float)physicsStopwatch.Elapsed.TotalSeconds;
                    foreach (var world in Game.Worlds)
                    {
                        world.Key.Physics?.Step(physicsStep);
                    }
                    physicsStopwatch.Restart();

                    // Heartbeat
                    RunService.Service.Heartbeat.Fire(step);
                }
            }