示例#1
0
        public static void TriggerDayChange()
        {
            try
            {
                if (GameHelper.Initialized == false)
                {
                    MvcApplication.Game_Start();
                }
                var worldService = NinjectHangFire.Kernel.GetService <IWorldService>();

                worldService.ProcessDayChange();
            }
            catch (Exception e)
            {
                try
                {
                    var emailService = NinjectHangFire.Kernel.GetService <IEmailService>();
                    emailService.InformAboutException(e);
                    Elmah.ErrorLog.GetDefault(null).Log(new Error(e));
                }
                catch (Exception)
                { }
                throw;
            }
        }
示例#2
0
        public static void TriggerHourChange()
        {
            if (GameHelper.Initialized == false)
            {
                MvcApplication.Game_Start();
            }

            var tradeService      = NinjectHangFire.Kernel.GetService <ITradeService>();
            var citizenRepository = NinjectHangFire.Kernel.GetService <ICitizenRepository>();

            tradeService.CancelInactiveTrade();

            GameHelper.ActivePlayers = citizenRepository.GetActivePlayerCount(GameHelper.CurrentDay);
        }